Index: src/objects-printer.cc |
diff --git a/src/objects-printer.cc b/src/objects-printer.cc |
index 3fd1579ba5212161202ffa803d4d6c3a9a72ba1a..1b31c1bfffe7a4408889e3527a0797e516c9ea63 100644 |
--- a/src/objects-printer.cc |
+++ b/src/objects-printer.cc |
@@ -432,8 +432,9 @@ void Map::MapPrint(std::ostream& os) { // NOLINT |
if (FLAG_unbox_double_fields) { |
os << "\n - layout descriptor: " << Brief(layout_descriptor()); |
} |
- if (HasTransitionArray()) { |
- os << "\n - transitions: " << Brief(transitions()); |
+ if (TransitionArray::NumberOfTransitions(raw_transitions()) > 0) { |
+ os << "\n - transitions: "; |
+ TransitionArray::PrintTransitions(os, raw_transitions()); |
} |
os << "\n - prototype: " << Brief(prototype()); |
os << "\n - constructor: " << Brief(GetConstructor()); |
@@ -1138,19 +1139,20 @@ void DescriptorArray::PrintDescriptors(std::ostream& os) { // NOLINT |
void TransitionArray::Print() { |
OFStream os(stdout); |
- this->PrintTransitions(os); |
+ TransitionArray::PrintTransitions(os, this); |
os << std::flush; |
} |
-void TransitionArray::PrintTransitions(std::ostream& os, |
+void TransitionArray::PrintTransitions(std::ostream& os, Object* transitions, |
bool print_header) { // NOLINT |
+ int num_transitions = NumberOfTransitions(transitions); |
if (print_header) { |
- os << "Transition array " << number_of_transitions() << "\n"; |
+ os << "Transition array " << num_transitions << "\n"; |
} |
- for (int i = 0; i < number_of_transitions(); i++) { |
- Name* key = GetKey(i); |
- Map* target = GetTarget(i); |
+ for (int i = 0; i < num_transitions; i++) { |
+ Name* key = GetKey(transitions, i); |
+ Map* target = GetTarget(transitions, i); |
os << " "; |
#ifdef OBJECT_PRINT |
key->NamePrint(os); |
@@ -1158,16 +1160,17 @@ void TransitionArray::PrintTransitions(std::ostream& os, |
key->ShortPrint(os); |
#endif |
os << ": "; |
- if (key == GetHeap()->nonextensible_symbol()) { |
+ Heap* heap = key->GetHeap(); |
+ if (key == heap->nonextensible_symbol()) { |
os << " (transition to non-extensible)"; |
- } else if (key == GetHeap()->sealed_symbol()) { |
+ } else if (key == heap->sealed_symbol()) { |
os << " (transition to sealed)"; |
- } else if (key == GetHeap()->frozen_symbol()) { |
+ } else if (key == heap->frozen_symbol()) { |
os << " (transition to frozen)"; |
- } else if (key == GetHeap()->elements_transition_symbol()) { |
+ } else if (key == heap->elements_transition_symbol()) { |
os << " (transition to " << ElementsKindToString(target->elements_kind()) |
<< ")"; |
- } else if (key == GetHeap()->observed_symbol()) { |
+ } else if (key == heap->observed_symbol()) { |
os << " (transition to Object.observe)"; |
} else { |
PropertyDetails details = GetTargetDetails(key, target); |
@@ -1177,7 +1180,9 @@ void TransitionArray::PrintTransitions(std::ostream& os, |
} |
os << (details.kind() == kData ? "data" : "accessor"); |
if (details.location() == kDescriptor) { |
- os << " " << Brief(GetTargetValue(i)); |
+ Object* value = |
+ target->instance_descriptors()->GetValue(target->LastAdded()); |
+ os << " " << Brief(value); |
} |
os << "), attrs: " << details.attributes(); |
} |
@@ -1187,8 +1192,7 @@ void TransitionArray::PrintTransitions(std::ostream& os, |
void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
- if (!map()->HasTransitionArray()) return; |
- map()->transitions()->PrintTransitions(os, false); |
+ TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
} |
#endif // defined(DEBUG) || defined(OBJECT_PRINT) |
} } // namespace v8::internal |