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