diff options
author | Refael Ackermann <refack@gmail.com> | 2014-09-29 13:20:04 +0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-10-08 15:35:57 +0400 |
commit | 939278ac059b44439d41aab12bf552c8ae3c52d0 (patch) | |
tree | 86c586915a96d308b1b04de679a8ae293caf3e41 /deps/v8/src/property.cc | |
parent | 4412a71d76a0fa002f627ec21d2337e089da6764 (diff) | |
download | android-node-v8-939278ac059b44439d41aab12bf552c8ae3c52d0.tar.gz android-node-v8-939278ac059b44439d41aab12bf552c8ae3c52d0.tar.bz2 android-node-v8-939278ac059b44439d41aab12bf552c8ae3c52d0.zip |
deps: update v8 to 3.28.73
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
Diffstat (limited to 'deps/v8/src/property.cc')
-rw-r--r-- | deps/v8/src/property.cc | 71 |
1 files changed, 28 insertions, 43 deletions
diff --git a/deps/v8/src/property.cc b/deps/v8/src/property.cc index e7d0c4e2f4..f1378ecdf9 100644 --- a/deps/v8/src/property.cc +++ b/deps/v8/src/property.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "property.h" +#include "src/property.h" -#include "handles-inl.h" +#include "src/handles-inl.h" +#include "src/ostreams.h" namespace v8 { namespace internal { @@ -19,62 +20,46 @@ void LookupResult::Iterate(ObjectVisitor* visitor) { } -#ifdef OBJECT_PRINT -void LookupResult::Print(FILE* out) { - if (!IsFound()) { - PrintF(out, "Not Found\n"); - return; - } +OStream& operator<<(OStream& os, const LookupResult& r) { + if (!r.IsFound()) return os << "Not Found\n"; - PrintF(out, "LookupResult:\n"); - PrintF(out, " -cacheable = %s\n", IsCacheable() ? "true" : "false"); - PrintF(out, " -attributes = %x\n", GetAttributes()); - if (IsTransition()) { - PrintF(out, " -transition target:\n"); - GetTransitionTarget()->Print(out); - PrintF(out, "\n"); + os << "LookupResult:\n"; + os << " -cacheable = " << (r.IsCacheable() ? "true" : "false") << "\n"; + os << " -attributes = " << hex << r.GetAttributes() << dec << "\n"; + if (r.IsTransition()) { + os << " -transition target:\n" << Brief(r.GetTransitionTarget()) << "\n"; } - switch (type()) { + switch (r.type()) { case NORMAL: - PrintF(out, " -type = normal\n"); - PrintF(out, " -entry = %d", GetDictionaryEntry()); - break; + return os << " -type = normal\n" + << " -entry = " << r.GetDictionaryEntry() << "\n"; case CONSTANT: - PrintF(out, " -type = constant\n"); - PrintF(out, " -value:\n"); - GetConstant()->Print(out); - PrintF(out, "\n"); - break; + return os << " -type = constant\n" + << " -value:\n" << Brief(r.GetConstant()) << "\n"; case FIELD: - PrintF(out, " -type = field\n"); - PrintF(out, " -index = %d\n", GetFieldIndex().field_index()); - PrintF(out, " -field type:\n"); - GetFieldType()->TypePrint(out); - break; + os << " -type = field\n" + << " -index = " << r.GetFieldIndex().property_index() << "\n" + << " -field type:"; + r.GetFieldType()->PrintTo(os); + return os << "\n"; case CALLBACKS: - PrintF(out, " -type = call backs\n"); - PrintF(out, " -callback object:\n"); - GetCallbackObject()->Print(out); - break; + return os << " -type = call backs\n" + << " -callback object:\n" << Brief(r.GetCallbackObject()); case HANDLER: - PrintF(out, " -type = lookup proxy\n"); - break; + return os << " -type = lookup proxy\n"; case INTERCEPTOR: - PrintF(out, " -type = lookup interceptor\n"); - break; + return os << " -type = lookup interceptor\n"; case NONEXISTENT: UNREACHABLE(); break; } + return os; } -void Descriptor::Print(FILE* out) { - PrintF(out, "Descriptor "); - GetKey()->ShortPrint(out); - PrintF(out, " @ "); - GetValue()->ShortPrint(out); +OStream& operator<<(OStream& os, const Descriptor& d) { + return os << "Descriptor " << Brief(*d.GetKey()) << " @ " + << Brief(*d.GetValue()); } -#endif } } // namespace v8::internal |