| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 HeapObject::PrintHeader(os, "TypeFeedbackVector"); | 550 HeapObject::PrintHeader(os, "TypeFeedbackVector"); |
| 551 os << " - length: " << length(); | 551 os << " - length: " << length(); |
| 552 if (length() == 0) { | 552 if (length() == 0) { |
| 553 os << " (empty)\n"; | 553 os << " (empty)\n"; |
| 554 return; | 554 return; |
| 555 } | 555 } |
| 556 | 556 |
| 557 os << "\n - ics with type info: " << ic_with_type_info_count(); | 557 os << "\n - ics with type info: " << ic_with_type_info_count(); |
| 558 os << "\n - generic ics: " << ic_generic_count(); | 558 os << "\n - generic ics: " << ic_generic_count(); |
| 559 | 559 |
| 560 if (Slots() > 0) { | 560 TypeFeedbackMetadataIterator iter(this); |
| 561 for (int i = 0; i < Slots(); i++) { | 561 while (iter.HasNext()) { |
| 562 FeedbackVectorSlot slot(i); | 562 FeedbackVectorSlot slot = iter.Next(); |
| 563 os << "\n Slot " << i << " [" << GetIndex(slot) | 563 FeedbackVectorSlotKind kind = iter.kind(); |
| 564 << "]: " << Brief(Get(slot)); | 564 |
| 565 os << "\n ICSlot " << slot.ToInt() << " " << kind << " "; |
| 566 switch (kind) { |
| 567 case FeedbackVectorSlotKind::LOAD_IC: { |
| 568 LoadICNexus nexus(this, slot); |
| 569 os << Code::ICState2String(nexus.StateFromFeedback()); |
| 570 break; |
| 571 } |
| 572 case FeedbackVectorSlotKind::KEYED_LOAD_IC: { |
| 573 KeyedLoadICNexus nexus(this, slot); |
| 574 os << Code::ICState2String(nexus.StateFromFeedback()); |
| 575 break; |
| 576 } |
| 577 case FeedbackVectorSlotKind::CALL_IC: { |
| 578 CallICNexus nexus(this, slot); |
| 579 os << Code::ICState2String(nexus.StateFromFeedback()); |
| 580 break; |
| 581 } |
| 582 case FeedbackVectorSlotKind::STORE_IC: { |
| 583 StoreICNexus nexus(this, slot); |
| 584 os << Code::ICState2String(nexus.StateFromFeedback()); |
| 585 break; |
| 586 } |
| 587 case FeedbackVectorSlotKind::KEYED_STORE_IC: { |
| 588 KeyedStoreICNexus nexus(this, slot); |
| 589 os << Code::ICState2String(nexus.StateFromFeedback()); |
| 590 break; |
| 591 } |
| 592 case FeedbackVectorSlotKind::GENERAL: |
| 593 break; |
| 594 case FeedbackVectorSlotKind::INVALID: |
| 595 case FeedbackVectorSlotKind::KINDS_NUMBER: |
| 596 UNREACHABLE(); |
| 597 break; |
| 565 } | 598 } |
| 566 } | |
| 567 | 599 |
| 568 if (ICSlots() > 0) { | 600 int entry_size = iter.entry_size(); |
| 569 DCHECK(elements_per_ic_slot() == 2); | 601 for (int i = 0; i < entry_size; i++) { |
| 570 | 602 int index = GetIndex(slot) + i; |
| 571 for (int i = 0; i < ICSlots(); i++) { | 603 os << "\n [" << index << "]: " << Brief(get(index)); |
| 572 FeedbackVectorICSlot slot(i); | |
| 573 FeedbackVectorSlotKind kind = GetKind(slot); | |
| 574 os << "\n ICSlot " << i << " " << kind << " "; | |
| 575 switch (kind) { | |
| 576 case FeedbackVectorSlotKind::LOAD_IC: { | |
| 577 LoadICNexus nexus(this, slot); | |
| 578 os << Code::ICState2String(nexus.StateFromFeedback()); | |
| 579 break; | |
| 580 } | |
| 581 case FeedbackVectorSlotKind::KEYED_LOAD_IC: { | |
| 582 KeyedLoadICNexus nexus(this, slot); | |
| 583 os << Code::ICState2String(nexus.StateFromFeedback()); | |
| 584 break; | |
| 585 } | |
| 586 case FeedbackVectorSlotKind::CALL_IC: { | |
| 587 CallICNexus nexus(this, slot); | |
| 588 os << Code::ICState2String(nexus.StateFromFeedback()); | |
| 589 break; | |
| 590 } | |
| 591 case FeedbackVectorSlotKind::STORE_IC: { | |
| 592 StoreICNexus nexus(this, slot); | |
| 593 os << Code::ICState2String(nexus.StateFromFeedback()); | |
| 594 break; | |
| 595 } | |
| 596 case FeedbackVectorSlotKind::KEYED_STORE_IC: { | |
| 597 KeyedStoreICNexus nexus(this, slot); | |
| 598 os << Code::ICState2String(nexus.StateFromFeedback()); | |
| 599 break; | |
| 600 } | |
| 601 case FeedbackVectorSlotKind::UNUSED: | |
| 602 case FeedbackVectorSlotKind::KINDS_NUMBER: | |
| 603 UNREACHABLE(); | |
| 604 break; | |
| 605 } | |
| 606 | |
| 607 os << "\n [" << GetIndex(slot) << "]: " << Brief(Get(slot)); | |
| 608 os << "\n [" << (GetIndex(slot) + 1) | |
| 609 << "]: " << Brief(get(GetIndex(slot) + 1)); | |
| 610 } | 604 } |
| 611 } | 605 } |
| 612 os << "\n"; | 606 os << "\n"; |
| 613 } | 607 } |
| 614 | 608 |
| 615 | 609 |
| 616 void JSValue::JSValuePrint(std::ostream& os) { // NOLINT | 610 void JSValue::JSValuePrint(std::ostream& os) { // NOLINT |
| 617 HeapObject::PrintHeader(os, "ValueObject"); | 611 HeapObject::PrintHeader(os, "ValueObject"); |
| 618 value()->Print(os); | 612 value()->Print(os); |
| 619 } | 613 } |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 } | 1294 } |
| 1301 } | 1295 } |
| 1302 | 1296 |
| 1303 | 1297 |
| 1304 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1298 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
| 1305 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1299 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
| 1306 } | 1300 } |
| 1307 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1301 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
| 1308 } // namespace internal | 1302 } // namespace internal |
| 1309 } // namespace v8 | 1303 } // namespace v8 |
| OLD | NEW |