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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } | 240 } |
241 os << " (field at offset " << index.property_index() << ")\n"; | 241 os << " (field at offset " << index.property_index() << ")\n"; |
242 break; | 242 break; |
243 } | 243 } |
244 case CONSTANT: | 244 case CONSTANT: |
245 os << Brief(descs->GetConstant(i)) << " (constant)\n"; | 245 os << Brief(descs->GetConstant(i)) << " (constant)\n"; |
246 break; | 246 break; |
247 case CALLBACKS: | 247 case CALLBACKS: |
248 os << Brief(descs->GetCallbacksObject(i)) << " (callback)\n"; | 248 os << Brief(descs->GetCallbacksObject(i)) << " (callback)\n"; |
249 break; | 249 break; |
250 case NORMAL: // only in slow mode | |
251 UNREACHABLE(); | |
252 break; | |
253 } | 250 } |
254 } | 251 } |
255 } else { | 252 } else { |
256 property_dictionary()->Print(os); | 253 property_dictionary()->Print(os); |
257 } | 254 } |
258 } | 255 } |
259 | 256 |
260 | 257 |
261 template <class T> | 258 template <class T> |
262 static void DoPrintElements(std::ostream& os, Object* object) { // NOLINT | 259 static void DoPrintElements(std::ostream& os, Object* object) { // NOLINT |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 | 1063 |
1067 | 1064 |
1068 void DescriptorArray::Print() { | 1065 void DescriptorArray::Print() { |
1069 OFStream os(stdout); | 1066 OFStream os(stdout); |
1070 this->PrintDescriptors(os); | 1067 this->PrintDescriptors(os); |
1071 os << std::flush; | 1068 os << std::flush; |
1072 } | 1069 } |
1073 | 1070 |
1074 | 1071 |
1075 void DescriptorArray::PrintDescriptors(std::ostream& os) { // NOLINT | 1072 void DescriptorArray::PrintDescriptors(std::ostream& os) { // NOLINT |
| 1073 HandleScope scope(GetIsolate()); |
1076 os << "Descriptor array " << number_of_descriptors() << "\n"; | 1074 os << "Descriptor array " << number_of_descriptors() << "\n"; |
1077 for (int i = 0; i < number_of_descriptors(); i++) { | 1075 for (int i = 0; i < number_of_descriptors(); i++) { |
1078 Descriptor desc; | 1076 Descriptor desc; |
1079 Get(i, &desc); | 1077 Get(i, &desc); |
1080 os << " " << i << ": " << desc << "\n"; | 1078 os << " " << i << ": " << desc << "\n"; |
1081 } | 1079 } |
1082 os << "\n"; | 1080 os << "\n"; |
1083 } | 1081 } |
1084 | 1082 |
1085 | 1083 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 case FIELD: { | 1148 case FIELD: { |
1151 os << " (transition to field)"; | 1149 os << " (transition to field)"; |
1152 break; | 1150 break; |
1153 } | 1151 } |
1154 case CONSTANT: | 1152 case CONSTANT: |
1155 os << " (transition to constant " << Brief(GetTargetValue(i)) << ")"; | 1153 os << " (transition to constant " << Brief(GetTargetValue(i)) << ")"; |
1156 break; | 1154 break; |
1157 case CALLBACKS: | 1155 case CALLBACKS: |
1158 os << " (transition to callback " << Brief(GetTargetValue(i)) << ")"; | 1156 os << " (transition to callback " << Brief(GetTargetValue(i)) << ")"; |
1159 break; | 1157 break; |
1160 // Values below are never in the target descriptor array. | |
1161 case NORMAL: | |
1162 UNREACHABLE(); | |
1163 break; | |
1164 } | 1158 } |
1165 os << ", attrs: " << details.attributes(); | 1159 os << ", attrs: " << details.attributes(); |
1166 } | 1160 } |
1167 os << " -> " << Brief(GetTarget(i)) << "\n"; | 1161 os << " -> " << Brief(GetTarget(i)) << "\n"; |
1168 } | 1162 } |
1169 } | 1163 } |
1170 | 1164 |
1171 | 1165 |
1172 #endif // OBJECT_PRINT | 1166 #endif // OBJECT_PRINT |
1173 | 1167 |
(...skipping 26 matching lines...) Expand all Loading... |
1200 return SNPrintF(str, "#<%s>", s->PrivateSymbolToName()); | 1194 return SNPrintF(str, "#<%s>", s->PrivateSymbolToName()); |
1201 } else { | 1195 } else { |
1202 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get()); | 1196 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get()); |
1203 } | 1197 } |
1204 } | 1198 } |
1205 } | 1199 } |
1206 | 1200 |
1207 | 1201 |
1208 #endif // TRACE_MAPS | 1202 #endif // TRACE_MAPS |
1209 } } // namespace v8::internal | 1203 } } // namespace v8::internal |
OLD | NEW |