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 14 matching lines...) Expand all Loading... |
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 STORE_DATA_PROPERTY_IN_LITERAL_IC, |
34 CREATE_CLOSURE, | 34 CREATE_CLOSURE, |
| 35 LITERAL, |
35 // This is a general purpose slot that occupies one feedback vector element. | 36 // This is a general purpose slot that occupies one feedback vector element. |
36 GENERAL, | 37 GENERAL, |
37 | 38 |
38 KINDS_NUMBER // Last value indicating number of kinds. | 39 KINDS_NUMBER // Last value indicating number of kinds. |
39 }; | 40 }; |
40 | 41 |
41 std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind); | 42 std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind); |
42 | 43 |
43 | 44 |
44 template <typename Derived> | 45 template <typename Derived> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 80 } |
80 | 81 |
81 FeedbackVectorSlot AddInterpreterCompareICSlot() { | 82 FeedbackVectorSlot AddInterpreterCompareICSlot() { |
82 return AddSlot(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC); | 83 return AddSlot(FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC); |
83 } | 84 } |
84 | 85 |
85 FeedbackVectorSlot AddGeneralSlot() { | 86 FeedbackVectorSlot AddGeneralSlot() { |
86 return AddSlot(FeedbackVectorSlotKind::GENERAL); | 87 return AddSlot(FeedbackVectorSlotKind::GENERAL); |
87 } | 88 } |
88 | 89 |
| 90 FeedbackVectorSlot AddLiteralSlot() { |
| 91 return AddSlot(FeedbackVectorSlotKind::LITERAL); |
| 92 } |
| 93 |
89 FeedbackVectorSlot AddStoreDataPropertyInLiteralICSlot() { | 94 FeedbackVectorSlot AddStoreDataPropertyInLiteralICSlot() { |
90 return AddSlot(FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC); | 95 return AddSlot(FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC); |
91 } | 96 } |
92 | 97 |
93 #ifdef OBJECT_PRINT | 98 #ifdef OBJECT_PRINT |
94 // For gdb debugging. | 99 // For gdb debugging. |
95 void Print(); | 100 void Print(); |
96 #endif // OBJECT_PRINT | 101 #endif // OBJECT_PRINT |
97 | 102 |
98 DECLARE_PRINTER(FeedbackVectorSpec) | 103 DECLARE_PRINTER(FeedbackVectorSpec) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // Returns number of slots in the vector. | 236 // Returns number of slots in the vector. |
232 inline int slot_count() const; | 237 inline int slot_count() const; |
233 | 238 |
234 inline TypeFeedbackMetadata* metadata() const; | 239 inline TypeFeedbackMetadata* metadata() const; |
235 inline int invocation_count() const; | 240 inline int invocation_count() const; |
236 | 241 |
237 // Conversion from a slot to an integer index to the underlying array. | 242 // Conversion from a slot to an integer index to the underlying array. |
238 static int GetIndex(FeedbackVectorSlot slot) { | 243 static int GetIndex(FeedbackVectorSlot slot) { |
239 return kReservedIndexCount + slot.ToInt(); | 244 return kReservedIndexCount + slot.ToInt(); |
240 } | 245 } |
241 static int GetIndexFromSpec(const FeedbackVectorSpec* spec, | |
242 FeedbackVectorSlot slot); | |
243 | 246 |
244 // Conversion from an integer index to the underlying array to a slot. | 247 // Conversion from an integer index to the underlying array to a slot. |
245 static inline FeedbackVectorSlot ToSlot(int index); | 248 static inline FeedbackVectorSlot ToSlot(int index); |
246 inline Object* Get(FeedbackVectorSlot slot) const; | 249 inline Object* Get(FeedbackVectorSlot slot) const; |
247 inline void Set(FeedbackVectorSlot slot, Object* value, | 250 inline void Set(FeedbackVectorSlot slot, Object* value, |
248 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 251 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
249 | 252 |
250 // Returns slot kind for given slot. | 253 // Returns slot kind for given slot. |
251 FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; | 254 FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; |
252 | 255 |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 InlineCacheState StateFromFeedback() const override; | 702 InlineCacheState StateFromFeedback() const override; |
700 }; | 703 }; |
701 | 704 |
702 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); | 705 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); |
703 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); | 706 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); |
704 | 707 |
705 } // namespace internal | 708 } // namespace internal |
706 } // namespace v8 | 709 } // namespace v8 |
707 | 710 |
708 #endif // V8_TRANSITIONS_H_ | 711 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |