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/checks.h" | 10 #include "src/checks.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 bool SpecDiffersFrom(const ZoneFeedbackVectorSpec* other_spec) const; | 106 bool SpecDiffersFrom(const ZoneFeedbackVectorSpec* other_spec) const; |
107 | 107 |
108 inline int Slots() const; | 108 inline int Slots() const; |
109 inline int ICSlots() const; | 109 inline int ICSlots() const; |
110 | 110 |
111 // Conversion from a slot or ic slot to an integer index to the underlying | 111 // Conversion from a slot or ic slot to an integer index to the underlying |
112 // array. | 112 // array. |
113 inline int GetIndex(FeedbackVectorSlot slot) const; | 113 inline int GetIndex(FeedbackVectorSlot slot) const; |
114 inline int GetIndex(FeedbackVectorICSlot slot) const; | 114 inline int GetIndex(FeedbackVectorICSlot slot) const; |
115 | 115 |
| 116 template <typename Spec> |
| 117 static int GetIndexFromSpec(const Spec* spec, FeedbackVectorSlot slot); |
| 118 template <typename Spec> |
| 119 static int GetIndexFromSpec(const Spec* spec, FeedbackVectorICSlot slot); |
| 120 |
116 // Conversion from an integer index to either a slot or an ic slot. The caller | 121 // Conversion from an integer index to either a slot or an ic slot. The caller |
117 // should know what kind she expects. | 122 // should know what kind she expects. |
118 inline FeedbackVectorSlot ToSlot(int index) const; | 123 inline FeedbackVectorSlot ToSlot(int index) const; |
119 inline FeedbackVectorICSlot ToICSlot(int index) const; | 124 inline FeedbackVectorICSlot ToICSlot(int index) const; |
120 inline Object* Get(FeedbackVectorSlot slot) const; | 125 inline Object* Get(FeedbackVectorSlot slot) const; |
121 inline void Set(FeedbackVectorSlot slot, Object* value, | 126 inline void Set(FeedbackVectorSlot slot, Object* value, |
122 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 127 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
123 inline Object* Get(FeedbackVectorICSlot slot) const; | 128 inline Object* Get(FeedbackVectorICSlot slot) const; |
124 inline void Set(FeedbackVectorICSlot slot, Object* value, | 129 inline void Set(FeedbackVectorICSlot slot, Object* value, |
125 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 130 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 KeyedAccessStoreMode GetKeyedAccessStoreMode() const; | 440 KeyedAccessStoreMode GetKeyedAccessStoreMode() const; |
436 IcCheckType GetKeyType() const; | 441 IcCheckType GetKeyType() const; |
437 | 442 |
438 InlineCacheState StateFromFeedback() const override; | 443 InlineCacheState StateFromFeedback() const override; |
439 Name* FindFirstName() const override; | 444 Name* FindFirstName() const override; |
440 }; | 445 }; |
441 } | 446 } |
442 } // namespace v8::internal | 447 } // namespace v8::internal |
443 | 448 |
444 #endif // V8_TRANSITIONS_H_ | 449 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |