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