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