OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_TYPE_FEEDBACK_VECTOR_H_ | 5 #ifndef V8_TYPE_FEEDBACK_VECTOR_H_ |
6 #define V8_TYPE_FEEDBACK_VECTOR_H_ | 6 #define V8_TYPE_FEEDBACK_VECTOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 INVALID, | 23 INVALID, |
24 | 24 |
25 CALL_IC, | 25 CALL_IC, |
26 LOAD_IC, | 26 LOAD_IC, |
27 LOAD_GLOBAL_IC, | 27 LOAD_GLOBAL_IC, |
28 KEYED_LOAD_IC, | 28 KEYED_LOAD_IC, |
29 STORE_IC, | 29 STORE_IC, |
30 KEYED_STORE_IC, | 30 KEYED_STORE_IC, |
31 INTERPRETER_BINARYOP_IC, | 31 INTERPRETER_BINARYOP_IC, |
32 INTERPRETER_COMPARE_IC, | 32 INTERPRETER_COMPARE_IC, |
| 33 STORE_DATA_PROPERTY_IN_LITERAL_IC, |
33 | 34 |
34 // This is a general purpose slot that occupies one feedback vector element. | 35 // This is a general purpose slot that occupies one feedback vector element. |
35 GENERAL, | 36 GENERAL, |
36 | 37 |
37 KINDS_NUMBER // Last value indicating number of kinds. | 38 KINDS_NUMBER // Last value indicating number of kinds. |
38 }; | 39 }; |
39 | 40 |
40 std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind); | 41 std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind); |
41 | 42 |
42 | 43 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 75 } |
75 | 76 |
76 FeedbackVectorSlot AddInterpreterCompareICSlot() { | 77 FeedbackVectorSlot AddInterpreterCompareICSlot() { |
77 return AddSlot(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC); | 78 return AddSlot(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC); |
78 } | 79 } |
79 | 80 |
80 FeedbackVectorSlot AddGeneralSlot() { | 81 FeedbackVectorSlot AddGeneralSlot() { |
81 return AddSlot(FeedbackVectorSlotKind::GENERAL); | 82 return AddSlot(FeedbackVectorSlotKind::GENERAL); |
82 } | 83 } |
83 | 84 |
| 85 FeedbackVectorSlot AddStoreDataPropertyInLiteralICSlot() { |
| 86 return AddSlot(FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC); |
| 87 } |
| 88 |
84 #ifdef OBJECT_PRINT | 89 #ifdef OBJECT_PRINT |
85 // For gdb debugging. | 90 // For gdb debugging. |
86 void Print(); | 91 void Print(); |
87 #endif // OBJECT_PRINT | 92 #endif // OBJECT_PRINT |
88 | 93 |
89 DECLARE_PRINTER(FeedbackVectorSpec) | 94 DECLARE_PRINTER(FeedbackVectorSpec) |
90 | 95 |
91 private: | 96 private: |
92 Derived* This() { return static_cast<Derived*>(this); } | 97 Derived* This() { return static_cast<Derived*>(this); } |
93 }; | 98 }; |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 } | 665 } |
661 MaybeHandle<Object> FindHandlerForMap(Handle<Map> map) const final { | 666 MaybeHandle<Object> FindHandlerForMap(Handle<Map> map) const final { |
662 return MaybeHandle<Code>(); | 667 return MaybeHandle<Code>(); |
663 } | 668 } |
664 bool FindHandlers(List<Handle<Object>>* code_list, | 669 bool FindHandlers(List<Handle<Object>>* code_list, |
665 int length = -1) const final { | 670 int length = -1) const final { |
666 return length == 0; | 671 return length == 0; |
667 } | 672 } |
668 }; | 673 }; |
669 | 674 |
| 675 class StoreDataPropertyInLiteralICNexus : public FeedbackNexus { |
| 676 public: |
| 677 StoreDataPropertyInLiteralICNexus(Handle<TypeFeedbackVector> vector, |
| 678 FeedbackVectorSlot slot) |
| 679 : FeedbackNexus(vector, slot) { |
| 680 DCHECK_EQ(FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC, |
| 681 vector->GetKind(slot)); |
| 682 } |
| 683 StoreDataPropertyInLiteralICNexus(TypeFeedbackVector* vector, |
| 684 FeedbackVectorSlot slot) |
| 685 : FeedbackNexus(vector, slot) { |
| 686 DCHECK_EQ(FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC, |
| 687 vector->GetKind(slot)); |
| 688 } |
| 689 |
| 690 void Clear(Code* host) { ConfigureUninitialized(); } |
| 691 |
| 692 void ConfigureMonomorphic(Handle<Name> name, Handle<Map> receiver_map); |
| 693 |
| 694 InlineCacheState StateFromFeedback() const override; |
| 695 }; |
| 696 |
670 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); | 697 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); |
671 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); | 698 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); |
672 | 699 |
673 } // namespace internal | 700 } // namespace internal |
674 } // namespace v8 | 701 } // namespace v8 |
675 | 702 |
676 #endif // V8_TRANSITIONS_H_ | 703 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |