diff options
Diffstat (limited to 'src/3rdparty/v8/src/property.cc')
-rw-r--r-- | src/3rdparty/v8/src/property.cc | 107 |
1 files changed, 44 insertions, 63 deletions
diff --git a/src/3rdparty/v8/src/property.cc b/src/3rdparty/v8/src/property.cc index 78f237d..d05ef2b 100644 --- a/src/3rdparty/v8/src/property.cc +++ b/src/3rdparty/v8/src/property.cc @@ -43,99 +43,80 @@ void LookupResult::Iterate(ObjectVisitor* visitor) { #ifdef OBJECT_PRINT void LookupResult::Print(FILE* out) { if (!IsFound()) { - PrintF(out, "Not Found\n"); + FPrintF(out, "Not Found\n"); return; } - PrintF(out, "LookupResult:\n"); - PrintF(out, " -cacheable = %s\n", IsCacheable() ? "true" : "false"); - PrintF(out, " -attributes = %x\n", GetAttributes()); + FPrintF(out, "LookupResult:\n"); + FPrintF(out, " -cacheable = %s\n", IsCacheable() ? "true" : "false"); + FPrintF(out, " -attributes = %x\n", GetAttributes()); switch (type()) { case NORMAL: - PrintF(out, " -type = normal\n"); - PrintF(out, " -entry = %d", GetDictionaryEntry()); - break; - case MAP_TRANSITION: - PrintF(out, " -type = map transition\n"); - PrintF(out, " -map:\n"); - GetTransitionMap()->Print(out); - PrintF(out, "\n"); - break; - case ELEMENTS_TRANSITION: - PrintF(out, " -type = elements transition\n"); - PrintF(out, " -map:\n"); - GetTransitionMap()->Print(out); - PrintF(out, "\n"); + FPrintF(out, " -type = normal\n"); + FPrintF(out, " -entry = %d", GetDictionaryEntry()); break; case CONSTANT_FUNCTION: - PrintF(out, " -type = constant function\n"); - PrintF(out, " -function:\n"); + FPrintF(out, " -type = constant function\n"); + FPrintF(out, " -function:\n"); GetConstantFunction()->Print(out); - PrintF(out, "\n"); + FPrintF(out, "\n"); break; case FIELD: - PrintF(out, " -type = field\n"); - PrintF(out, " -index = %d", GetFieldIndex()); - PrintF(out, "\n"); + FPrintF(out, " -type = field\n"); + FPrintF(out, " -index = %d", GetFieldIndex()); + FPrintF(out, "\n"); break; case CALLBACKS: - PrintF(out, " -type = call backs\n"); - PrintF(out, " -callback object:\n"); + FPrintF(out, " -type = call backs\n"); + FPrintF(out, " -callback object:\n"); GetCallbackObject()->Print(out); break; case HANDLER: - PrintF(out, " -type = lookup proxy\n"); + FPrintF(out, " -type = lookup proxy\n"); break; case INTERCEPTOR: - PrintF(out, " -type = lookup interceptor\n"); - break; - case CONSTANT_TRANSITION: - PrintF(out, " -type = constant property transition\n"); - PrintF(out, " -map:\n"); - GetTransitionMap()->Print(out); - PrintF(out, "\n"); + FPrintF(out, " -type = lookup interceptor\n"); break; - case NULL_DESCRIPTOR: - PrintF(out, " =type = null descriptor\n"); + case TRANSITION: + switch (GetTransitionDetails().type()) { + case FIELD: + FPrintF(out, " -type = map transition\n"); + FPrintF(out, " -map:\n"); + GetTransitionMap()->Print(out); + FPrintF(out, "\n"); + return; + case CONSTANT_FUNCTION: + FPrintF(out, " -type = constant property transition\n"); + FPrintF(out, " -map:\n"); + GetTransitionMap()->Print(out); + FPrintF(out, "\n"); + return; + case CALLBACKS: + FPrintF(out, " -type = callbacks transition\n"); + FPrintF(out, " -callback object:\n"); + GetCallbackObject()->Print(out); + return; + default: + UNREACHABLE(); + return; + } + case NONEXISTENT: + UNREACHABLE(); break; } } void Descriptor::Print(FILE* out) { - PrintF(out, "Descriptor "); + FPrintF(out, "Descriptor "); GetKey()->ShortPrint(out); - PrintF(out, " @ "); + FPrintF(out, " @ "); GetValue()->ShortPrint(out); - PrintF(out, " %d\n", GetDetails().index()); + FPrintF(out, " %d\n", GetDetails().descriptor_index()); } #endif -bool Descriptor::ContainsTransition() { - switch (details_.type()) { - case MAP_TRANSITION: - case CONSTANT_TRANSITION: - case ELEMENTS_TRANSITION: - return true; - case CALLBACKS: { - if (!value_->IsAccessorPair()) return false; - AccessorPair* accessors = AccessorPair::cast(value_); - return accessors->getter()->IsMap() || accessors->setter()->IsMap(); - } - case NORMAL: - case FIELD: - case CONSTANT_FUNCTION: - case HANDLER: - case INTERCEPTOR: - case NULL_DESCRIPTOR: - return false; - } - UNREACHABLE(); // Keep the compiler happy. - return false; -} - - } } // namespace v8::internal |