| 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 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 | 1129 |
| 1130 void TransitionArray::PrintTransitions(std::ostream& os, | 1130 void TransitionArray::PrintTransitions(std::ostream& os, |
| 1131 bool print_header) { // NOLINT | 1131 bool print_header) { // NOLINT |
| 1132 if (print_header) { | 1132 if (print_header) { |
| 1133 os << "Transition array " << number_of_transitions() << "\n"; | 1133 os << "Transition array " << number_of_transitions() << "\n"; |
| 1134 } | 1134 } |
| 1135 for (int i = 0; i < number_of_transitions(); i++) { | 1135 for (int i = 0; i < number_of_transitions(); i++) { |
| 1136 Name* key = GetKey(i); | 1136 Name* key = GetKey(i); |
| 1137 Map* target = GetTarget(i); | |
| 1138 os << " "; | 1137 os << " "; |
| 1139 key->NamePrint(os); | 1138 key->NamePrint(os); |
| 1140 os << ": "; | 1139 os << ": "; |
| 1141 if (key == GetHeap()->frozen_symbol()) { | 1140 if (key == GetHeap()->frozen_symbol()) { |
| 1142 os << " (transition to frozen)"; | 1141 os << " (transition to frozen)"; |
| 1143 } else if (key == GetHeap()->elements_transition_symbol()) { | 1142 } else if (key == GetHeap()->elements_transition_symbol()) { |
| 1144 os << " (transition to " << ElementsKindToString(target->elements_kind()) | 1143 os << " (transition to " |
| 1145 << ")"; | 1144 << ElementsKindToString(GetTarget(i)->elements_kind()) << ")"; |
| 1146 } else if (key == GetHeap()->observed_symbol()) { | 1145 } else if (key == GetHeap()->observed_symbol()) { |
| 1147 os << " (transition to Object.observe)"; | 1146 os << " (transition to Object.observe)"; |
| 1148 } else { | 1147 } else { |
| 1149 PropertyDetails details = GetTargetDetails(key, target); | 1148 PropertyDetails details = GetTargetDetails(i); |
| 1150 switch (details.type()) { | 1149 switch (details.type()) { |
| 1151 case FIELD: { | 1150 case FIELD: { |
| 1152 os << " (transition to field)"; | 1151 os << " (transition to field)"; |
| 1153 break; | 1152 break; |
| 1154 } | 1153 } |
| 1155 case CONSTANT: | 1154 case CONSTANT: |
| 1156 os << " (transition to constant " << Brief(GetTargetValue(i)) << ")"; | 1155 os << " (transition to constant " << Brief(GetTargetValue(i)) << ")"; |
| 1157 break; | 1156 break; |
| 1158 case CALLBACKS: | 1157 case CALLBACKS: |
| 1159 os << " (transition to callback " << Brief(GetTargetValue(i)) << ")"; | 1158 os << " (transition to callback " << Brief(GetTargetValue(i)) << ")"; |
| 1160 break; | 1159 break; |
| 1161 // Values below are never in the target descriptor array. | 1160 // Values below are never in the target descriptor array. |
| 1162 case NORMAL: | 1161 case NORMAL: |
| 1163 UNREACHABLE(); | 1162 UNREACHABLE(); |
| 1164 break; | 1163 break; |
| 1165 } | 1164 } |
| 1166 os << ", attrs: " << details.attributes(); | 1165 os << ", attrs: " << details.attributes(); |
| 1167 } | 1166 } |
| 1168 os << " -> " << Brief(target) << "\n"; | 1167 os << " -> " << Brief(GetTarget(i)) << "\n"; |
| 1169 } | 1168 } |
| 1170 } | 1169 } |
| 1171 | 1170 |
| 1172 | 1171 |
| 1173 #endif // OBJECT_PRINT | 1172 #endif // OBJECT_PRINT |
| 1174 | 1173 |
| 1175 | 1174 |
| 1176 #if TRACE_MAPS | 1175 #if TRACE_MAPS |
| 1177 | 1176 |
| 1178 | 1177 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1201 return SNPrintF(str, "#<%s>", s->PrivateSymbolToName()); | 1200 return SNPrintF(str, "#<%s>", s->PrivateSymbolToName()); |
| 1202 } else { | 1201 } else { |
| 1203 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get()); | 1202 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get()); |
| 1204 } | 1203 } |
| 1205 } | 1204 } |
| 1206 } | 1205 } |
| 1207 | 1206 |
| 1208 | 1207 |
| 1209 #endif // TRACE_MAPS | 1208 #endif // TRACE_MAPS |
| 1210 } } // namespace v8::internal | 1209 } } // namespace v8::internal |
| OLD | NEW |