| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| 802 case FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: { | 808 case FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: { |
| 803 StoreDataPropertyInLiteralICNexus nexus(this, slot); | 809 StoreDataPropertyInLiteralICNexus nexus(this, slot); |
| 804 os << Code::ICState2String(nexus.StateFromFeedback()); | 810 os << Code::ICState2String(nexus.StateFromFeedback()); |
| 805 break; | 811 break; |
| 806 } | 812 } |
| 813 case FeedbackVectorSlotKind::CREATE_CLOSURE: { |
| 814 // TODO(mvstanton): Integrate this into the iterator. |
| 815 int parameter_value = metadata()->GetParameter(parameter_index++); |
| 816 os << "[" << parameter_value << "]"; |
| 817 break; |
| 818 } |
| 807 case FeedbackVectorSlotKind::GENERAL: | 819 case FeedbackVectorSlotKind::GENERAL: |
| 808 break; | 820 break; |
| 809 case FeedbackVectorSlotKind::INVALID: | 821 case FeedbackVectorSlotKind::INVALID: |
| 810 case FeedbackVectorSlotKind::KINDS_NUMBER: | 822 case FeedbackVectorSlotKind::KINDS_NUMBER: |
| 811 UNREACHABLE(); | 823 UNREACHABLE(); |
| 812 break; | 824 break; |
| 813 } | 825 } |
| 814 | 826 |
| 815 int entry_size = iter.entry_size(); | 827 int entry_size = iter.entry_size(); |
| 816 for (int i = 0; i < entry_size; i++) { | 828 for (int i = 0; i < entry_size; i++) { |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 printf("Not a transition array\n"); | 1702 printf("Not a transition array\n"); |
| 1691 } else { | 1703 } else { |
| 1692 reinterpret_cast<i::TransitionArray*>(object)->Print(); | 1704 reinterpret_cast<i::TransitionArray*>(object)->Print(); |
| 1693 } | 1705 } |
| 1694 } | 1706 } |
| 1695 | 1707 |
| 1696 extern void _v8_internal_Print_StackTrace() { | 1708 extern void _v8_internal_Print_StackTrace() { |
| 1697 i::Isolate* isolate = i::Isolate::Current(); | 1709 i::Isolate* isolate = i::Isolate::Current(); |
| 1698 isolate->PrintStack(stdout); | 1710 isolate->PrintStack(stdout); |
| 1699 } | 1711 } |
| OLD | NEW |