| 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 os << "\n - transitions: " << Brief(transitions()); | 435 os << "\n - transitions: " << Brief(transitions()); |
| 436 } | 436 } |
| 437 os << "\n - prototype: " << Brief(prototype()); | 437 os << "\n - prototype: " << Brief(prototype()); |
| 438 os << "\n - constructor: " << Brief(constructor()); | 438 os << "\n - constructor: " << Brief(constructor()); |
| 439 os << "\n - code cache: " << Brief(code_cache()); | 439 os << "\n - code cache: " << Brief(code_cache()); |
| 440 os << "\n - dependent code: " << Brief(dependent_code()); | 440 os << "\n - dependent code: " << Brief(dependent_code()); |
| 441 os << "\n"; | 441 os << "\n"; |
| 442 } | 442 } |
| 443 | 443 |
| 444 | 444 |
| 445 // TODO(ishell): Move prototype transitions to separate class. |
| 446 void Map::PrintPrototypeTransitions(std::ostream& os) { // NOLINT |
| 447 FixedArray* cache = GetPrototypeTransitions(); |
| 448 int number_of_transitions = NumberOfProtoTransitions(); |
| 449 os << "Prototype transition array " << number_of_transitions << "\n"; |
| 450 const int proto_offset = |
| 451 kProtoTransitionHeaderSize + kProtoTransitionPrototypeOffset; |
| 452 const int map_offset = kProtoTransitionHeaderSize + kProtoTransitionMapOffset; |
| 453 const int step = kProtoTransitionElementsPerEntry; |
| 454 for (int i = 0; i < number_of_transitions; i++) { |
| 455 Object* prototype = cache->get(proto_offset + i * step); |
| 456 Object* map = cache->get(map_offset + i * step); |
| 457 os << " " << Brief(prototype) << " -> " << Brief(map) << "\n"; |
| 458 } |
| 459 os << "\n"; |
| 460 } |
| 461 |
| 462 |
| 445 void CodeCache::CodeCachePrint(std::ostream& os) { // NOLINT | 463 void CodeCache::CodeCachePrint(std::ostream& os) { // NOLINT |
| 446 HeapObject::PrintHeader(os, "CodeCache"); | 464 HeapObject::PrintHeader(os, "CodeCache"); |
| 447 os << "\n - default_cache: " << Brief(default_cache()); | 465 os << "\n - default_cache: " << Brief(default_cache()); |
| 448 os << "\n - normal_type_cache: " << Brief(normal_type_cache()); | 466 os << "\n - normal_type_cache: " << Brief(normal_type_cache()); |
| 449 } | 467 } |
| 450 | 468 |
| 451 | 469 |
| 452 void PolymorphicCodeCache::PolymorphicCodeCachePrint( | 470 void PolymorphicCodeCache::PolymorphicCodeCachePrint( |
| 453 std::ostream& os) { // NOLINT | 471 std::ostream& os) { // NOLINT |
| 454 HeapObject::PrintHeader(os, "PolymorphicCodeCache"); | 472 HeapObject::PrintHeader(os, "PolymorphicCodeCache"); |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 } | 1202 } |
| 1185 } | 1203 } |
| 1186 | 1204 |
| 1187 | 1205 |
| 1188 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1206 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
| 1189 if (!map()->HasTransitionArray()) return; | 1207 if (!map()->HasTransitionArray()) return; |
| 1190 map()->transitions()->PrintTransitions(os, false); | 1208 map()->transitions()->PrintTransitions(os, false); |
| 1191 } | 1209 } |
| 1192 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1210 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
| 1193 } } // namespace v8::internal | 1211 } } // namespace v8::internal |
| OLD | NEW |