| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 static inline TypeFeedbackMetadata* cast(Object* obj); | 129 static inline TypeFeedbackMetadata* cast(Object* obj); |
| 130 | 130 |
| 131 static const int kSlotsCountIndex = 0; | 131 static const int kSlotsCountIndex = 0; |
| 132 static const int kReservedIndexCount = 1; | 132 static const int kReservedIndexCount = 1; |
| 133 | 133 |
| 134 // Returns number of feedback vector elements used by given slot kind. | 134 // Returns number of feedback vector elements used by given slot kind. |
| 135 static inline int GetSlotSize(FeedbackVectorSlotKind kind); | 135 static inline int GetSlotSize(FeedbackVectorSlotKind kind); |
| 136 | 136 |
| 137 bool SpecDiffersFrom(const FeedbackVectorSpec* other_spec) const; | 137 bool SpecDiffersFrom(const FeedbackVectorSpec* other_spec) const; |
| 138 | 138 |
| 139 bool DiffersFrom(const TypeFeedbackMetadata* other_metadata) const; |
| 140 |
| 141 inline bool is_empty() const; |
| 142 |
| 139 // Returns number of slots in the vector. | 143 // Returns number of slots in the vector. |
| 140 inline int slot_count() const; | 144 inline int slot_count() const; |
| 141 | 145 |
| 142 // Returns slot kind for given slot. | 146 // Returns slot kind for given slot. |
| 143 FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; | 147 FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; |
| 144 | 148 |
| 145 template <typename Spec> | 149 template <typename Spec> |
| 146 static Handle<TypeFeedbackMetadata> New(Isolate* isolate, const Spec* spec); | 150 static Handle<TypeFeedbackMetadata> New(Isolate* isolate, const Spec* spec); |
| 147 | 151 |
| 148 #ifdef OBJECT_PRINT | 152 #ifdef OBJECT_PRINT |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 inline void ComputeCounts(int* with_type_info, int* generic); | 191 inline void ComputeCounts(int* with_type_info, int* generic); |
| 188 | 192 |
| 189 inline bool is_empty() const; | 193 inline bool is_empty() const; |
| 190 | 194 |
| 191 // Returns number of slots in the vector. | 195 // Returns number of slots in the vector. |
| 192 inline int slot_count() const; | 196 inline int slot_count() const; |
| 193 | 197 |
| 194 inline TypeFeedbackMetadata* metadata() const; | 198 inline TypeFeedbackMetadata* metadata() const; |
| 195 | 199 |
| 196 // Conversion from a slot to an integer index to the underlying array. | 200 // Conversion from a slot to an integer index to the underlying array. |
| 197 inline int GetIndex(FeedbackVectorSlot slot) const; | 201 static inline int GetIndex(FeedbackVectorSlot slot); |
| 198 static int GetIndexFromSpec(const FeedbackVectorSpec* spec, | 202 static int GetIndexFromSpec(const FeedbackVectorSpec* spec, |
| 199 FeedbackVectorSlot slot); | 203 FeedbackVectorSlot slot); |
| 200 | 204 |
| 201 // Conversion from an integer index to the underlying array to a slot. | 205 // Conversion from an integer index to the underlying array to a slot. |
| 202 inline FeedbackVectorSlot ToSlot(int index) const; | 206 static inline FeedbackVectorSlot ToSlot(int index); |
| 203 inline Object* Get(FeedbackVectorSlot slot) const; | 207 inline Object* Get(FeedbackVectorSlot slot) const; |
| 204 inline void Set(FeedbackVectorSlot slot, Object* value, | 208 inline void Set(FeedbackVectorSlot slot, Object* value, |
| 205 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 209 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 206 | 210 |
| 207 // Returns slot kind for given slot. | 211 // Returns slot kind for given slot. |
| 208 inline FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; | 212 inline FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; |
| 209 | 213 |
| 210 static Handle<TypeFeedbackVector> New(Isolate* isolate, | 214 static Handle<TypeFeedbackVector> New(Isolate* isolate, |
| 211 Handle<TypeFeedbackMetadata> metadata); | 215 Handle<TypeFeedbackMetadata> metadata); |
| 212 | 216 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 KeyedAccessStoreMode GetKeyedAccessStoreMode() const; | 543 KeyedAccessStoreMode GetKeyedAccessStoreMode() const; |
| 540 IcCheckType GetKeyType() const; | 544 IcCheckType GetKeyType() const; |
| 541 | 545 |
| 542 InlineCacheState StateFromFeedback() const override; | 546 InlineCacheState StateFromFeedback() const override; |
| 543 Name* FindFirstName() const override; | 547 Name* FindFirstName() const override; |
| 544 }; | 548 }; |
| 545 } // namespace internal | 549 } // namespace internal |
| 546 } // namespace v8 | 550 } // namespace v8 |
| 547 | 551 |
| 548 #endif // V8_TRANSITIONS_H_ | 552 #endif // V8_TRANSITIONS_H_ |
| OLD | NEW |