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/objects.h" | 5 #include "src/objects.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/interpreter/bytecodes.h" | 9 #include "src/interpreter/bytecodes.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 break; | 69 break; |
70 case FIXED_ARRAY_TYPE: | 70 case FIXED_ARRAY_TYPE: |
71 FixedArray::cast(this)->FixedArrayPrint(os); | 71 FixedArray::cast(this)->FixedArrayPrint(os); |
72 break; | 72 break; |
73 case BYTE_ARRAY_TYPE: | 73 case BYTE_ARRAY_TYPE: |
74 ByteArray::cast(this)->ByteArrayPrint(os); | 74 ByteArray::cast(this)->ByteArrayPrint(os); |
75 break; | 75 break; |
76 case BYTECODE_ARRAY_TYPE: | 76 case BYTECODE_ARRAY_TYPE: |
77 BytecodeArray::cast(this)->BytecodeArrayPrint(os); | 77 BytecodeArray::cast(this)->BytecodeArrayPrint(os); |
78 break; | 78 break; |
| 79 case TRANSITION_ARRAY_TYPE: |
| 80 TransitionArray::cast(this)->TransitionArrayPrint(os); |
| 81 break; |
79 case FREE_SPACE_TYPE: | 82 case FREE_SPACE_TYPE: |
80 FreeSpace::cast(this)->FreeSpacePrint(os); | 83 FreeSpace::cast(this)->FreeSpacePrint(os); |
81 break; | 84 break; |
82 | 85 |
83 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 86 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
84 case Fixed##Type##Array::kInstanceType: \ | 87 case Fixed##Type##Array::kInstanceType: \ |
85 Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \ | 88 Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \ |
86 break; | 89 break; |
87 | 90 |
88 TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY) | 91 TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY) |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 if (is_the_hole(i)) { | 549 if (is_the_hole(i)) { |
547 os << "<the hole>"; | 550 os << "<the hole>"; |
548 } else { | 551 } else { |
549 os << get_scalar(i); | 552 os << get_scalar(i); |
550 } | 553 } |
551 } | 554 } |
552 os << "\n"; | 555 os << "\n"; |
553 } | 556 } |
554 | 557 |
555 | 558 |
| 559 void TransitionArray::TransitionArrayPrint(std::ostream& os) { // NOLINT |
| 560 HeapObject::PrintHeader(os, "TransitionArray"); |
| 561 os << " - capacity: " << length(); |
| 562 for (int i = 0; i < length(); i++) { |
| 563 os << "\n [" << i << "]: " << Brief(get(i)); |
| 564 if (i == kNextLinkIndex) os << " (next link)"; |
| 565 if (i == kPrototypeTransitionsIndex) os << " (prototype transitions)"; |
| 566 if (i == kTransitionLengthIndex) os << " (number of transitions)"; |
| 567 } |
| 568 os << "\n"; |
| 569 } |
| 570 |
| 571 |
556 void TypeFeedbackMetadata::Print() { | 572 void TypeFeedbackMetadata::Print() { |
557 OFStream os(stdout); | 573 OFStream os(stdout); |
558 TypeFeedbackMetadataPrint(os); | 574 TypeFeedbackMetadataPrint(os); |
559 os << std::flush; | 575 os << std::flush; |
560 } | 576 } |
561 | 577 |
562 | 578 |
563 void TypeFeedbackMetadata::TypeFeedbackMetadataPrint( | 579 void TypeFeedbackMetadata::TypeFeedbackMetadataPrint( |
564 std::ostream& os) { // NOLINT | 580 std::ostream& os) { // NOLINT |
565 HeapObject::PrintHeader(os, "TypeFeedbackMetadata"); | 581 HeapObject::PrintHeader(os, "TypeFeedbackMetadata"); |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1346 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1331 Object* transitions = map()->raw_transitions(); | 1347 Object* transitions = map()->raw_transitions(); |
1332 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1348 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
1333 if (num_transitions == 0) return; | 1349 if (num_transitions == 0) return; |
1334 os << "\n - transitions"; | 1350 os << "\n - transitions"; |
1335 TransitionArray::PrintTransitions(os, transitions, false); | 1351 TransitionArray::PrintTransitions(os, transitions, false); |
1336 } | 1352 } |
1337 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1353 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1338 } // namespace internal | 1354 } // namespace internal |
1339 } // namespace v8 | 1355 } // namespace v8 |
OLD | NEW |