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 <iomanip> | 7 #include <iomanip> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 std::ostream& os) { // NOLINT | 717 std::ostream& os) { // NOLINT |
718 HeapObject::PrintHeader(os, "TypeFeedbackMetadata"); | 718 HeapObject::PrintHeader(os, "TypeFeedbackMetadata"); |
719 os << "\n - length: " << length(); | 719 os << "\n - length: " << length(); |
720 if (length() == 0) { | 720 if (length() == 0) { |
721 os << " (empty)\n"; | 721 os << " (empty)\n"; |
722 return; | 722 return; |
723 } | 723 } |
724 os << "\n - slot_count: " << slot_count(); | 724 os << "\n - slot_count: " << slot_count(); |
725 | 725 |
726 TypeFeedbackMetadataIterator iter(this); | 726 TypeFeedbackMetadataIterator iter(this); |
| 727 int parameter_index = 0; |
727 while (iter.HasNext()) { | 728 while (iter.HasNext()) { |
728 FeedbackVectorSlot slot = iter.Next(); | 729 FeedbackVectorSlot slot = iter.Next(); |
729 FeedbackVectorSlotKind kind = iter.kind(); | 730 FeedbackVectorSlotKind kind = iter.kind(); |
730 os << "\n Slot " << slot << " " << kind; | 731 os << "\n Slot " << slot << " " << kind; |
| 732 if (TypeFeedbackMetadata::SlotRequiresParameter(kind)) { |
| 733 int parameter_value = this->GetParameter(parameter_index++); |
| 734 os << " [" << parameter_value << "]"; |
| 735 } |
731 } | 736 } |
732 os << "\n"; | 737 os << "\n"; |
733 } | 738 } |
734 | 739 |
735 | 740 |
736 void TypeFeedbackVector::Print() { | 741 void TypeFeedbackVector::Print() { |
737 OFStream os(stdout); | 742 OFStream os(stdout); |
738 TypeFeedbackVectorPrint(os); | 743 TypeFeedbackVectorPrint(os); |
739 os << std::flush; | 744 os << std::flush; |
740 } | 745 } |
741 | 746 |
742 | 747 |
743 void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT | 748 void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT |
744 HeapObject::PrintHeader(os, "TypeFeedbackVector"); | 749 HeapObject::PrintHeader(os, "TypeFeedbackVector"); |
745 os << "\n - length: " << length(); | 750 os << "\n - length: " << length(); |
746 if (length() == 0) { | 751 if (length() == 0) { |
747 os << " (empty)\n"; | 752 os << " (empty)\n"; |
748 return; | 753 return; |
749 } | 754 } |
750 | 755 |
| 756 int parameter_index = 0; |
751 TypeFeedbackMetadataIterator iter(metadata()); | 757 TypeFeedbackMetadataIterator iter(metadata()); |
752 while (iter.HasNext()) { | 758 while (iter.HasNext()) { |
753 FeedbackVectorSlot slot = iter.Next(); | 759 FeedbackVectorSlot slot = iter.Next(); |
754 FeedbackVectorSlotKind kind = iter.kind(); | 760 FeedbackVectorSlotKind kind = iter.kind(); |
755 | 761 |
756 os << "\n Slot " << slot << " " << kind; | 762 os << "\n Slot " << slot << " " << kind; |
757 os << " "; | 763 os << " "; |
758 switch (kind) { | 764 switch (kind) { |
759 case FeedbackVectorSlotKind::LOAD_IC: { | 765 case FeedbackVectorSlotKind::LOAD_IC: { |
760 LoadICNexus nexus(this, slot); | 766 LoadICNexus nexus(this, slot); |
(...skipping 28 matching lines...) Expand all Loading... |
789 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: { | 795 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: { |
790 BinaryOpICNexus nexus(this, slot); | 796 BinaryOpICNexus nexus(this, slot); |
791 os << Code::ICState2String(nexus.StateFromFeedback()); | 797 os << Code::ICState2String(nexus.StateFromFeedback()); |
792 break; | 798 break; |
793 } | 799 } |
794 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: { | 800 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: { |
795 CompareICNexus nexus(this, slot); | 801 CompareICNexus nexus(this, slot); |
796 os << Code::ICState2String(nexus.StateFromFeedback()); | 802 os << Code::ICState2String(nexus.StateFromFeedback()); |
797 break; | 803 break; |
798 } | 804 } |
| 805 case FeedbackVectorSlotKind::CREATE_CLOSURE: { |
| 806 // TODO(mvstanton): Integrate this into the iterator. |
| 807 int parameter_value = metadata()->GetParameter(parameter_index++); |
| 808 os << "[" << parameter_value << "]"; |
| 809 break; |
| 810 } |
799 case FeedbackVectorSlotKind::GENERAL: | 811 case FeedbackVectorSlotKind::GENERAL: |
800 break; | 812 break; |
801 case FeedbackVectorSlotKind::INVALID: | 813 case FeedbackVectorSlotKind::INVALID: |
802 case FeedbackVectorSlotKind::KINDS_NUMBER: | 814 case FeedbackVectorSlotKind::KINDS_NUMBER: |
803 UNREACHABLE(); | 815 UNREACHABLE(); |
804 break; | 816 break; |
805 } | 817 } |
806 | 818 |
807 int entry_size = iter.entry_size(); | 819 int entry_size = iter.entry_size(); |
808 for (int i = 0; i < entry_size; i++) { | 820 for (int i = 0; i < entry_size; i++) { |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 printf("Not a transition array\n"); | 1692 printf("Not a transition array\n"); |
1681 } else { | 1693 } else { |
1682 reinterpret_cast<i::TransitionArray*>(object)->Print(); | 1694 reinterpret_cast<i::TransitionArray*>(object)->Print(); |
1683 } | 1695 } |
1684 } | 1696 } |
1685 | 1697 |
1686 extern void _v8_internal_Print_StackTrace() { | 1698 extern void _v8_internal_Print_StackTrace() { |
1687 i::Isolate* isolate = i::Isolate::Current(); | 1699 i::Isolate* isolate = i::Isolate::Current(); |
1688 isolate->PrintStack(stdout); | 1700 isolate->PrintStack(stdout); |
1689 } | 1701 } |
OLD | NEW |