| 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 FEEDBACK_VECTOR_TYPE: |
| 70 TypeFeedbackVector::cast(this)->TypeFeedbackVectorPrint(os); |
| 71 break; |
| 69 case FIXED_ARRAY_TYPE: | 72 case FIXED_ARRAY_TYPE: |
| 70 FixedArray::cast(this)->FixedArrayPrint(os); | 73 FixedArray::cast(this)->FixedArrayPrint(os); |
| 71 break; | 74 break; |
| 72 case BYTE_ARRAY_TYPE: | 75 case BYTE_ARRAY_TYPE: |
| 73 ByteArray::cast(this)->ByteArrayPrint(os); | 76 ByteArray::cast(this)->ByteArrayPrint(os); |
| 74 break; | 77 break; |
| 75 case FREE_SPACE_TYPE: | 78 case FREE_SPACE_TYPE: |
| 76 FreeSpace::cast(this)->FreeSpacePrint(os); | 79 FreeSpace::cast(this)->FreeSpacePrint(os); |
| 77 break; | 80 break; |
| 78 | 81 |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 if (is_the_hole(i)) { | 500 if (is_the_hole(i)) { |
| 498 os << "<the hole>"; | 501 os << "<the hole>"; |
| 499 } else { | 502 } else { |
| 500 os << get_scalar(i); | 503 os << get_scalar(i); |
| 501 } | 504 } |
| 502 } | 505 } |
| 503 os << "\n"; | 506 os << "\n"; |
| 504 } | 507 } |
| 505 | 508 |
| 506 | 509 |
| 510 void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT |
| 511 HeapObject::PrintHeader(os, "TypeFeedbackVector"); |
| 512 os << " - length: " << length(); |
| 513 if (length() == 0) { |
| 514 os << " (empty)\n"; |
| 515 return; |
| 516 } |
| 517 |
| 518 os << "\n - ics with type info: " << ic_with_type_info_count(); |
| 519 os << "\n - generic ics: " << ic_generic_count(); |
| 520 |
| 521 if (Slots() > 0) { |
| 522 for (int i = 0; i < Slots(); i++) { |
| 523 FeedbackVectorSlot slot(i); |
| 524 os << "\n Slot " << i << " [" << GetIndex(slot) |
| 525 << "]: " << Brief(Get(slot)); |
| 526 } |
| 527 } |
| 528 |
| 529 if (ICSlots() > 0) { |
| 530 DCHECK(elements_per_ic_slot() == 2); |
| 531 |
| 532 for (int i = 0; i < ICSlots(); i++) { |
| 533 FeedbackVectorICSlot slot(i); |
| 534 Code::Kind kind = GetKind(slot); |
| 535 os << "\n ICSlot " << i; |
| 536 if (kind == Code::LOAD_IC) { |
| 537 LoadICNexus nexus(this, slot); |
| 538 os << " LOAD_IC " << Code::ICState2String(nexus.StateFromFeedback()); |
| 539 } else if (kind == Code::KEYED_LOAD_IC) { |
| 540 KeyedLoadICNexus nexus(this, slot); |
| 541 os << " KEYED_LOAD_IC " |
| 542 << Code::ICState2String(nexus.StateFromFeedback()); |
| 543 } else { |
| 544 DCHECK(kind == Code::CALL_IC); |
| 545 CallICNexus nexus(this, slot); |
| 546 os << " CALL_IC " << Code::ICState2String(nexus.StateFromFeedback()); |
| 547 } |
| 548 |
| 549 os << "\n [" << GetIndex(slot) << "]: " << Brief(Get(slot)); |
| 550 os << "\n [" << (GetIndex(slot) + 1) |
| 551 << "]: " << Brief(get(GetIndex(slot) + 1)); |
| 552 } |
| 553 } |
| 554 os << "\n"; |
| 555 } |
| 556 |
| 557 |
| 507 void JSValue::JSValuePrint(std::ostream& os) { // NOLINT | 558 void JSValue::JSValuePrint(std::ostream& os) { // NOLINT |
| 508 HeapObject::PrintHeader(os, "ValueObject"); | 559 HeapObject::PrintHeader(os, "ValueObject"); |
| 509 value()->Print(os); | 560 value()->Print(os); |
| 510 } | 561 } |
| 511 | 562 |
| 512 | 563 |
| 513 void JSMessageObject::JSMessageObjectPrint(std::ostream& os) { // NOLINT | 564 void JSMessageObject::JSMessageObjectPrint(std::ostream& os) { // NOLINT |
| 514 HeapObject::PrintHeader(os, "JSMessageObject"); | 565 HeapObject::PrintHeader(os, "JSMessageObject"); |
| 515 os << " - type: " << type(); | 566 os << " - type: " << type(); |
| 516 os << "\n - arguments: " << Brief(argument()); | 567 os << "\n - arguments: " << Brief(argument()); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 // os << "\n - script ="; | 808 // os << "\n - script ="; |
| 758 // script()->Print(os); | 809 // script()->Print(os); |
| 759 os << "\n - function token position = " << function_token_position(); | 810 os << "\n - function token position = " << function_token_position(); |
| 760 os << "\n - start position = " << start_position(); | 811 os << "\n - start position = " << start_position(); |
| 761 os << "\n - end position = " << end_position(); | 812 os << "\n - end position = " << end_position(); |
| 762 os << "\n - is expression = " << is_expression(); | 813 os << "\n - is expression = " << is_expression(); |
| 763 os << "\n - debug info = " << Brief(debug_info()); | 814 os << "\n - debug info = " << Brief(debug_info()); |
| 764 os << "\n - length = " << length(); | 815 os << "\n - length = " << length(); |
| 765 os << "\n - optimized_code_map = " << Brief(optimized_code_map()); | 816 os << "\n - optimized_code_map = " << Brief(optimized_code_map()); |
| 766 os << "\n - feedback_vector = "; | 817 os << "\n - feedback_vector = "; |
| 767 feedback_vector()->FixedArrayPrint(os); | 818 feedback_vector()->TypeFeedbackVectorPrint(os); |
| 768 os << "\n"; | 819 os << "\n"; |
| 769 } | 820 } |
| 770 | 821 |
| 771 | 822 |
| 772 void JSGlobalProxy::JSGlobalProxyPrint(std::ostream& os) { // NOLINT | 823 void JSGlobalProxy::JSGlobalProxyPrint(std::ostream& os) { // NOLINT |
| 773 os << "global_proxy "; | 824 os << "global_proxy "; |
| 774 JSObjectPrint(os); | 825 JSObjectPrint(os); |
| 775 os << "native context : " << Brief(native_context()); | 826 os << "native context : " << Brief(native_context()); |
| 776 os << "\n"; | 827 os << "\n"; |
| 777 } | 828 } |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 } | 1223 } |
| 1173 } | 1224 } |
| 1174 | 1225 |
| 1175 | 1226 |
| 1176 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1227 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
| 1177 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1228 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
| 1178 } | 1229 } |
| 1179 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1230 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
| 1180 } // namespace internal | 1231 } // namespace internal |
| 1181 } // namespace v8 | 1232 } // namespace v8 |
| OLD | NEW |