| 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 |
| 139 // Returns number of slots in the vector. | 141 // Returns number of slots in the vector. |
| 140 inline int slot_count() const; | 142 inline int slot_count() const; |
| 141 | 143 |
| 142 // Returns slot kind for given slot. | 144 // Returns slot kind for given slot. |
| 143 FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; | 145 FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; |
| 144 | 146 |
| 145 template <typename Spec> | 147 template <typename Spec> |
| 146 static Handle<TypeFeedbackMetadata> New(Isolate* isolate, const Spec* spec); | 148 static Handle<TypeFeedbackMetadata> New(Isolate* isolate, const Spec* spec); |
| 147 | 149 |
| 148 #ifdef OBJECT_PRINT | 150 #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); | 189 inline void ComputeCounts(int* with_type_info, int* generic); |
| 188 | 190 |
| 189 inline bool is_empty() const; | 191 inline bool is_empty() const; |
| 190 | 192 |
| 191 // Returns number of slots in the vector. | 193 // Returns number of slots in the vector. |
| 192 inline int slot_count() const; | 194 inline int slot_count() const; |
| 193 | 195 |
| 194 inline TypeFeedbackMetadata* metadata() const; | 196 inline TypeFeedbackMetadata* metadata() const; |
| 195 | 197 |
| 196 // Conversion from a slot to an integer index to the underlying array. | 198 // Conversion from a slot to an integer index to the underlying array. |
| 197 inline int GetIndex(FeedbackVectorSlot slot) const; | 199 static inline int GetIndex(FeedbackVectorSlot slot); |
| 198 static int GetIndexFromSpec(const FeedbackVectorSpec* spec, | 200 static int GetIndexFromSpec(const FeedbackVectorSpec* spec, |
| 199 FeedbackVectorSlot slot); | 201 FeedbackVectorSlot slot); |
| 200 | 202 |
| 201 // Conversion from an integer index to the underlying array to a slot. | 203 // Conversion from an integer index to the underlying array to a slot. |
| 202 inline FeedbackVectorSlot ToSlot(int index) const; | 204 static inline FeedbackVectorSlot ToSlot(int index); |
| 203 inline Object* Get(FeedbackVectorSlot slot) const; | 205 inline Object* Get(FeedbackVectorSlot slot) const; |
| 204 inline void Set(FeedbackVectorSlot slot, Object* value, | 206 inline void Set(FeedbackVectorSlot slot, Object* value, |
| 205 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 207 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 206 | 208 |
| 207 // Returns slot kind for given slot. | 209 // Returns slot kind for given slot. |
| 208 inline FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; | 210 inline FeedbackVectorSlotKind GetKind(FeedbackVectorSlot slot) const; |
| 209 | 211 |
| 210 static Handle<TypeFeedbackVector> New(Isolate* isolate, | 212 static Handle<TypeFeedbackVector> New(Isolate* isolate, |
| 211 Handle<TypeFeedbackMetadata> metadata); | 213 Handle<TypeFeedbackMetadata> metadata); |
| 212 | 214 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 KeyedAccessStoreMode GetKeyedAccessStoreMode() const; | 536 KeyedAccessStoreMode GetKeyedAccessStoreMode() const; |
| 535 IcCheckType GetKeyType() const; | 537 IcCheckType GetKeyType() const; |
| 536 | 538 |
| 537 InlineCacheState StateFromFeedback() const override; | 539 InlineCacheState StateFromFeedback() const override; |
| 538 Name* FindFirstName() const override; | 540 Name* FindFirstName() const override; |
| 539 }; | 541 }; |
| 540 } // namespace internal | 542 } // namespace internal |
| 541 } // namespace v8 | 543 } // namespace v8 |
| 542 | 544 |
| 543 #endif // V8_TRANSITIONS_H_ | 545 #endif // V8_TRANSITIONS_H_ |
| OLD | NEW |