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/v8.h" | 5 #include "src/v8.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/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 } | 1071 } |
1072 | 1072 |
1073 | 1073 |
1074 void TransitionArray::PrintTransitions(std::ostream& os, | 1074 void TransitionArray::PrintTransitions(std::ostream& os, |
1075 bool print_header) { // NOLINT | 1075 bool print_header) { // NOLINT |
1076 if (print_header) { | 1076 if (print_header) { |
1077 os << "Transition array " << number_of_transitions() << "\n"; | 1077 os << "Transition array " << number_of_transitions() << "\n"; |
1078 } | 1078 } |
1079 for (int i = 0; i < number_of_transitions(); i++) { | 1079 for (int i = 0; i < number_of_transitions(); i++) { |
1080 Name* key = GetKey(i); | 1080 Name* key = GetKey(i); |
| 1081 Map* target = GetTarget(i); |
1081 os << " "; | 1082 os << " "; |
1082 key->NamePrint(os); | 1083 key->NamePrint(os); |
1083 os << ": "; | 1084 os << ": "; |
1084 if (key == GetHeap()->frozen_symbol()) { | 1085 if (key == GetHeap()->frozen_symbol()) { |
1085 os << " (transition to frozen)"; | 1086 os << " (transition to frozen)"; |
1086 } else if (key == GetHeap()->elements_transition_symbol()) { | 1087 } else if (key == GetHeap()->elements_transition_symbol()) { |
1087 os << " (transition to " | 1088 os << " (transition to " << ElementsKindToString(target->elements_kind()) |
1088 << ElementsKindToString(GetTarget(i)->elements_kind()) << ")"; | 1089 << ")"; |
1089 } else if (key == GetHeap()->observed_symbol()) { | 1090 } else if (key == GetHeap()->observed_symbol()) { |
1090 os << " (transition to Object.observe)"; | 1091 os << " (transition to Object.observe)"; |
1091 } else { | 1092 } else { |
1092 PropertyDetails details = GetTargetDetails(i); | 1093 PropertyDetails details = GetTargetDetails(key, target); |
1093 switch (details.type()) { | 1094 switch (details.type()) { |
1094 case FIELD: { | 1095 case FIELD: { |
1095 os << " (transition to field)"; | 1096 os << " (transition to field)"; |
1096 break; | 1097 break; |
1097 } | 1098 } |
1098 case CONSTANT: | 1099 case CONSTANT: |
1099 os << " (transition to constant " << Brief(GetTargetValue(i)) << ")"; | 1100 os << " (transition to constant " << Brief(GetTargetValue(i)) << ")"; |
1100 break; | 1101 break; |
1101 case CALLBACKS: | 1102 case CALLBACKS: |
1102 os << " (transition to callback " << Brief(GetTargetValue(i)) << ")"; | 1103 os << " (transition to callback " << Brief(GetTargetValue(i)) << ")"; |
1103 break; | 1104 break; |
1104 // Values below are never in the target descriptor array. | 1105 // Values below are never in the target descriptor array. |
1105 case NORMAL: | 1106 case NORMAL: |
1106 UNREACHABLE(); | 1107 UNREACHABLE(); |
1107 break; | 1108 break; |
1108 } | 1109 } |
1109 os << ", attrs: " << details.attributes(); | 1110 os << ", attrs: " << details.attributes(); |
1110 } | 1111 } |
1111 os << " -> " << Brief(GetTarget(i)) << "\n"; | 1112 os << " -> " << Brief(target) << "\n"; |
1112 } | 1113 } |
1113 } | 1114 } |
1114 | 1115 |
1115 | 1116 |
1116 #endif // OBJECT_PRINT | 1117 #endif // OBJECT_PRINT |
1117 | 1118 |
1118 | 1119 |
1119 } } // namespace v8::internal | 1120 } } // namespace v8::internal |
OLD | NEW |