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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 HeapNumber::cast(this)->HeapNumberPrint(os); | 56 HeapNumber::cast(this)->HeapNumberPrint(os); |
57 break; | 57 break; |
58 case MUTABLE_HEAP_NUMBER_TYPE: | 58 case MUTABLE_HEAP_NUMBER_TYPE: |
59 os << "<mutable "; | 59 os << "<mutable "; |
60 HeapNumber::cast(this)->HeapNumberPrint(os); | 60 HeapNumber::cast(this)->HeapNumberPrint(os); |
61 os << ">"; | 61 os << ">"; |
62 break; | 62 break; |
63 case FIXED_DOUBLE_ARRAY_TYPE: | 63 case FIXED_DOUBLE_ARRAY_TYPE: |
64 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); | 64 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); |
65 break; | 65 break; |
| 66 case CONSTANT_POOL_ARRAY_TYPE: |
| 67 ConstantPoolArray::cast(this)->ConstantPoolArrayPrint(os); |
| 68 break; |
66 case FIXED_ARRAY_TYPE: | 69 case FIXED_ARRAY_TYPE: |
67 FixedArray::cast(this)->FixedArrayPrint(os); | 70 FixedArray::cast(this)->FixedArrayPrint(os); |
68 break; | 71 break; |
69 case BYTE_ARRAY_TYPE: | 72 case BYTE_ARRAY_TYPE: |
70 ByteArray::cast(this)->ByteArrayPrint(os); | 73 ByteArray::cast(this)->ByteArrayPrint(os); |
71 break; | 74 break; |
72 case FREE_SPACE_TYPE: | 75 case FREE_SPACE_TYPE: |
73 FreeSpace::cast(this)->FreeSpacePrint(os); | 76 FreeSpace::cast(this)->FreeSpacePrint(os); |
74 break; | 77 break; |
75 | 78 |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 os << " - length: " << length(); | 494 os << " - length: " << length(); |
492 for (int i = 0; i < length(); i++) { | 495 for (int i = 0; i < length(); i++) { |
493 os << "\n [" << i << "]: "; | 496 os << "\n [" << i << "]: "; |
494 if (is_the_hole(i)) { | 497 if (is_the_hole(i)) { |
495 os << "<the hole>"; | 498 os << "<the hole>"; |
496 } else { | 499 } else { |
497 os << get_scalar(i); | 500 os << get_scalar(i); |
498 } | 501 } |
499 } | 502 } |
500 os << "\n"; | 503 os << "\n"; |
| 504 } |
| 505 |
| 506 |
| 507 void ConstantPoolArray::ConstantPoolArrayPrint(std::ostream& os) { // NOLINT |
| 508 HeapObject::PrintHeader(os, "ConstantPoolArray"); |
| 509 os << " - length: " << length(); |
| 510 for (int i = 0; i <= last_index(INT32, SMALL_SECTION); i++) { |
| 511 if (i < last_index(INT64, SMALL_SECTION)) { |
| 512 os << "\n [" << i << "]: double: " << get_int64_entry_as_double(i); |
| 513 } else if (i <= last_index(CODE_PTR, SMALL_SECTION)) { |
| 514 os << "\n [" << i << "]: code target pointer: " |
| 515 << reinterpret_cast<void*>(get_code_ptr_entry(i)); |
| 516 } else if (i <= last_index(HEAP_PTR, SMALL_SECTION)) { |
| 517 os << "\n [" << i << "]: heap pointer: " |
| 518 << reinterpret_cast<void*>(get_heap_ptr_entry(i)); |
| 519 } else if (i <= last_index(INT32, SMALL_SECTION)) { |
| 520 os << "\n [" << i << "]: int32: " << get_int32_entry(i); |
| 521 } |
| 522 } |
| 523 if (is_extended_layout()) { |
| 524 os << "\n Extended section:"; |
| 525 for (int i = first_extended_section_index(); |
| 526 i <= last_index(INT32, EXTENDED_SECTION); i++) { |
| 527 if (i < last_index(INT64, EXTENDED_SECTION)) { |
| 528 os << "\n [" << i << "]: double: " << get_int64_entry_as_double(i); |
| 529 } else if (i <= last_index(CODE_PTR, EXTENDED_SECTION)) { |
| 530 os << "\n [" << i << "]: code target pointer: " |
| 531 << reinterpret_cast<void*>(get_code_ptr_entry(i)); |
| 532 } else if (i <= last_index(HEAP_PTR, EXTENDED_SECTION)) { |
| 533 os << "\n [" << i << "]: heap pointer: " |
| 534 << reinterpret_cast<void*>(get_heap_ptr_entry(i)); |
| 535 } else if (i <= last_index(INT32, EXTENDED_SECTION)) { |
| 536 os << "\n [" << i << "]: int32: " << get_int32_entry(i); |
| 537 } |
| 538 } |
| 539 } |
| 540 os << "\n"; |
501 } | 541 } |
502 | 542 |
503 | 543 |
504 void JSValue::JSValuePrint(std::ostream& os) { // NOLINT | 544 void JSValue::JSValuePrint(std::ostream& os) { // NOLINT |
505 HeapObject::PrintHeader(os, "ValueObject"); | 545 HeapObject::PrintHeader(os, "ValueObject"); |
506 value()->Print(os); | 546 value()->Print(os); |
507 } | 547 } |
508 | 548 |
509 | 549 |
510 void JSMessageObject::JSMessageObjectPrint(std::ostream& os) { // NOLINT | 550 void JSMessageObject::JSMessageObjectPrint(std::ostream& os) { // NOLINT |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 } | 1208 } |
1169 } | 1209 } |
1170 | 1210 |
1171 | 1211 |
1172 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1212 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1173 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1213 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
1174 } | 1214 } |
1175 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1215 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1176 } // namespace internal | 1216 } // namespace internal |
1177 } // namespace v8 | 1217 } // namespace v8 |
OLD | NEW |