| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 FLOAT32X4_TYPE: | 63 case FLOAT32X4_TYPE: |
| 64 Float32x4::cast(this)->Float32x4Print(os); | 64 Float32x4::cast(this)->Float32x4Print(os); |
| 65 break; | 65 break; |
| 66 case FIXED_DOUBLE_ARRAY_TYPE: | 66 case FIXED_DOUBLE_ARRAY_TYPE: |
| 67 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); | 67 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); |
| 68 break; | 68 break; |
| 69 case CONSTANT_POOL_ARRAY_TYPE: | |
| 70 ConstantPoolArray::cast(this)->ConstantPoolArrayPrint(os); | |
| 71 break; | |
| 72 case FIXED_ARRAY_TYPE: | 69 case FIXED_ARRAY_TYPE: |
| 73 FixedArray::cast(this)->FixedArrayPrint(os); | 70 FixedArray::cast(this)->FixedArrayPrint(os); |
| 74 break; | 71 break; |
| 75 case BYTE_ARRAY_TYPE: | 72 case BYTE_ARRAY_TYPE: |
| 76 ByteArray::cast(this)->ByteArrayPrint(os); | 73 ByteArray::cast(this)->ByteArrayPrint(os); |
| 77 break; | 74 break; |
| 78 case FREE_SPACE_TYPE: | 75 case FREE_SPACE_TYPE: |
| 79 FreeSpace::cast(this)->FreeSpacePrint(os); | 76 FreeSpace::cast(this)->FreeSpacePrint(os); |
| 80 break; | 77 break; |
| 81 | 78 |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 if (is_the_hole(i)) { | 497 if (is_the_hole(i)) { |
| 501 os << "<the hole>"; | 498 os << "<the hole>"; |
| 502 } else { | 499 } else { |
| 503 os << get_scalar(i); | 500 os << get_scalar(i); |
| 504 } | 501 } |
| 505 } | 502 } |
| 506 os << "\n"; | 503 os << "\n"; |
| 507 } | 504 } |
| 508 | 505 |
| 509 | 506 |
| 510 void ConstantPoolArray::ConstantPoolArrayPrint(std::ostream& os) { // NOLINT | |
| 511 HeapObject::PrintHeader(os, "ConstantPoolArray"); | |
| 512 os << " - length: " << length(); | |
| 513 for (int i = 0; i <= last_index(INT32, SMALL_SECTION); i++) { | |
| 514 if (i < last_index(INT64, SMALL_SECTION)) { | |
| 515 os << "\n [" << i << "]: double: " << get_int64_entry_as_double(i); | |
| 516 } else if (i <= last_index(CODE_PTR, SMALL_SECTION)) { | |
| 517 os << "\n [" << i << "]: code target pointer: " | |
| 518 << reinterpret_cast<void*>(get_code_ptr_entry(i)); | |
| 519 } else if (i <= last_index(HEAP_PTR, SMALL_SECTION)) { | |
| 520 os << "\n [" << i << "]: heap pointer: " | |
| 521 << reinterpret_cast<void*>(get_heap_ptr_entry(i)); | |
| 522 } else if (i <= last_index(INT32, SMALL_SECTION)) { | |
| 523 os << "\n [" << i << "]: int32: " << get_int32_entry(i); | |
| 524 } | |
| 525 } | |
| 526 if (is_extended_layout()) { | |
| 527 os << "\n Extended section:"; | |
| 528 for (int i = first_extended_section_index(); | |
| 529 i <= last_index(INT32, EXTENDED_SECTION); i++) { | |
| 530 if (i < last_index(INT64, EXTENDED_SECTION)) { | |
| 531 os << "\n [" << i << "]: double: " << get_int64_entry_as_double(i); | |
| 532 } else if (i <= last_index(CODE_PTR, EXTENDED_SECTION)) { | |
| 533 os << "\n [" << i << "]: code target pointer: " | |
| 534 << reinterpret_cast<void*>(get_code_ptr_entry(i)); | |
| 535 } else if (i <= last_index(HEAP_PTR, EXTENDED_SECTION)) { | |
| 536 os << "\n [" << i << "]: heap pointer: " | |
| 537 << reinterpret_cast<void*>(get_heap_ptr_entry(i)); | |
| 538 } else if (i <= last_index(INT32, EXTENDED_SECTION)) { | |
| 539 os << "\n [" << i << "]: int32: " << get_int32_entry(i); | |
| 540 } | |
| 541 } | |
| 542 } | |
| 543 os << "\n"; | |
| 544 } | |
| 545 | |
| 546 | |
| 547 void JSValue::JSValuePrint(std::ostream& os) { // NOLINT | 507 void JSValue::JSValuePrint(std::ostream& os) { // NOLINT |
| 548 HeapObject::PrintHeader(os, "ValueObject"); | 508 HeapObject::PrintHeader(os, "ValueObject"); |
| 549 value()->Print(os); | 509 value()->Print(os); |
| 550 } | 510 } |
| 551 | 511 |
| 552 | 512 |
| 553 void JSMessageObject::JSMessageObjectPrint(std::ostream& os) { // NOLINT | 513 void JSMessageObject::JSMessageObjectPrint(std::ostream& os) { // NOLINT |
| 554 HeapObject::PrintHeader(os, "JSMessageObject"); | 514 HeapObject::PrintHeader(os, "JSMessageObject"); |
| 555 os << " - type: " << type(); | 515 os << " - type: " << type(); |
| 556 os << "\n - arguments: " << Brief(argument()); | 516 os << "\n - arguments: " << Brief(argument()); |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 } | 1171 } |
| 1212 } | 1172 } |
| 1213 | 1173 |
| 1214 | 1174 |
| 1215 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1175 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
| 1216 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1176 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
| 1217 } | 1177 } |
| 1218 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1178 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
| 1219 } // namespace internal | 1179 } // namespace internal |
| 1220 } // namespace v8 | 1180 } // namespace v8 |
| OLD | NEW |