OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
9 #include "src/interpreter/bytecodes.h" | 9 #include "src/interpreter/bytecodes.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 if (is_stable()) os << "\n - stable_map"; | 489 if (is_stable()) os << "\n - stable_map"; |
490 if (is_dictionary_map()) os << "\n - dictionary_map"; | 490 if (is_dictionary_map()) os << "\n - dictionary_map"; |
491 if (has_hidden_prototype()) os << "\n - has_hidden_prototype"; | 491 if (has_hidden_prototype()) os << "\n - has_hidden_prototype"; |
492 if (has_named_interceptor()) os << " - named_interceptor"; | 492 if (has_named_interceptor()) os << " - named_interceptor"; |
493 if (has_indexed_interceptor()) os << "\n - indexed_interceptor"; | 493 if (has_indexed_interceptor()) os << "\n - indexed_interceptor"; |
494 if (is_undetectable()) os << "\n - undetectable"; | 494 if (is_undetectable()) os << "\n - undetectable"; |
495 if (is_callable()) os << "\n - callable"; | 495 if (is_callable()) os << "\n - callable"; |
496 if (is_constructor()) os << "\n - constructor"; | 496 if (is_constructor()) os << "\n - constructor"; |
497 if (is_access_check_needed()) os << "\n - access_check_needed"; | 497 if (is_access_check_needed()) os << "\n - access_check_needed"; |
498 if (!is_extensible()) os << "\n - non-extensible"; | 498 if (!is_extensible()) os << "\n - non-extensible"; |
499 if (is_observed()) os << "\n - observed"; | |
500 if (is_prototype_map()) { | 499 if (is_prototype_map()) { |
501 os << "\n - prototype_map"; | 500 os << "\n - prototype_map"; |
502 os << "\n - prototype info: " << Brief(prototype_info()); | 501 os << "\n - prototype info: " << Brief(prototype_info()); |
503 } else { | 502 } else { |
504 os << "\n - back pointer: " << Brief(GetBackPointer()); | 503 os << "\n - back pointer: " << Brief(GetBackPointer()); |
505 } | 504 } |
506 os << "\n - instance descriptors " << (owns_descriptors() ? "(own) " : "") | 505 os << "\n - instance descriptors " << (owns_descriptors() ? "(own) " : "") |
507 << "#" << NumberOfOwnDescriptors() << ": " | 506 << "#" << NumberOfOwnDescriptors() << ": " |
508 << Brief(instance_descriptors()); | 507 << Brief(instance_descriptors()); |
509 if (FLAG_unbox_double_fields) { | 508 if (FLAG_unbox_double_fields) { |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 os << "(transition to non-extensible)"; | 1308 os << "(transition to non-extensible)"; |
1310 } else if (key == heap->sealed_symbol()) { | 1309 } else if (key == heap->sealed_symbol()) { |
1311 os << "(transition to sealed)"; | 1310 os << "(transition to sealed)"; |
1312 } else if (key == heap->frozen_symbol()) { | 1311 } else if (key == heap->frozen_symbol()) { |
1313 os << "(transition to frozen)"; | 1312 os << "(transition to frozen)"; |
1314 } else if (key == heap->elements_transition_symbol()) { | 1313 } else if (key == heap->elements_transition_symbol()) { |
1315 os << "(transition to " << ElementsKindToString(target->elements_kind()) | 1314 os << "(transition to " << ElementsKindToString(target->elements_kind()) |
1316 << ")"; | 1315 << ")"; |
1317 } else if (key == heap->strict_function_transition_symbol()) { | 1316 } else if (key == heap->strict_function_transition_symbol()) { |
1318 os << " (transition to strict function)"; | 1317 os << " (transition to strict function)"; |
1319 } else if (key == heap->observed_symbol()) { | |
1320 os << " (transition to Object.observe)"; | |
1321 } else { | 1318 } else { |
1322 PropertyDetails details = GetTargetDetails(key, target); | 1319 PropertyDetails details = GetTargetDetails(key, target); |
1323 os << "(transition to "; | 1320 os << "(transition to "; |
1324 if (details.location() == kDescriptor) { | 1321 if (details.location() == kDescriptor) { |
1325 os << "immutable "; | 1322 os << "immutable "; |
1326 } | 1323 } |
1327 os << (details.kind() == kData ? "data" : "accessor"); | 1324 os << (details.kind() == kData ? "data" : "accessor"); |
1328 if (details.location() == kDescriptor) { | 1325 if (details.location() == kDescriptor) { |
1329 Object* value = | 1326 Object* value = |
1330 target->instance_descriptors()->GetValue(target->LastAdded()); | 1327 target->instance_descriptors()->GetValue(target->LastAdded()); |
1331 os << " " << Brief(value); | 1328 os << " " << Brief(value); |
1332 } | 1329 } |
1333 os << "), attrs: " << details.attributes(); | 1330 os << "), attrs: " << details.attributes(); |
1334 } | 1331 } |
1335 os << " -> " << Brief(target); | 1332 os << " -> " << Brief(target); |
1336 } | 1333 } |
1337 } | 1334 } |
1338 | 1335 |
1339 | 1336 |
1340 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1337 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1341 Object* transitions = map()->raw_transitions(); | 1338 Object* transitions = map()->raw_transitions(); |
1342 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1339 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
1343 if (num_transitions == 0) return; | 1340 if (num_transitions == 0) return; |
1344 os << "\n - transitions"; | 1341 os << "\n - transitions"; |
1345 TransitionArray::PrintTransitions(os, transitions, false); | 1342 TransitionArray::PrintTransitions(os, transitions, false); |
1346 } | 1343 } |
1347 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1344 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1348 } // namespace internal | 1345 } // namespace internal |
1349 } // namespace v8 | 1346 } // namespace v8 |
OLD | NEW |