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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // 2..N: slot kinds packed into a bit vector | 149 // 2..N: slot kinds packed into a bit vector |
150 // | 150 // |
151 class TypeFeedbackMetadata : public FixedArray { | 151 class TypeFeedbackMetadata : public FixedArray { |
152 public: | 152 public: |
153 // Casting. | 153 // Casting. |
154 static inline TypeFeedbackMetadata* cast(Object* obj); | 154 static inline TypeFeedbackMetadata* cast(Object* obj); |
155 | 155 |
156 static const int kSlotsCountIndex = 0; | 156 static const int kSlotsCountIndex = 0; |
157 static const int kReservedIndexCount = 1; | 157 static const int kReservedIndexCount = 1; |
158 | 158 |
159 static const int kNameTableEntrySize = 2; | |
160 static const int kNameTableSlotIndex = 0; | |
161 static const int kNameTableNameIndex = 1; | |
162 | |
163 // Returns number of feedback vector elements used by given slot kind. | 159 // Returns number of feedback vector elements used by given slot kind. |
164 static inline int GetSlotSize(FeedbackVectorSlotKind kind); | 160 static inline int GetSlotSize(FeedbackVectorSlotKind kind); |
165 | 161 |
166 bool SpecDiffersFrom(const FeedbackVectorSpec* other_spec) const; | 162 bool SpecDiffersFrom(const FeedbackVectorSpec* other_spec) const; |
167 | 163 |
168 bool DiffersFrom(const TypeFeedbackMetadata* other_metadata) const; | 164 bool DiffersFrom(const TypeFeedbackMetadata* other_metadata) const; |
169 | 165 |
170 inline bool is_empty() const; | 166 inline bool is_empty() const; |
171 | 167 |
172 // Returns number of slots in the vector. | 168 // Returns number of slots in the vector. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // A raw version of the uninitialized sentinel that's safe to read during | 272 // A raw version of the uninitialized sentinel that's safe to read during |
277 // garbage collection (e.g., for patching the cache). | 273 // garbage collection (e.g., for patching the cache). |
278 static inline Symbol* RawUninitializedSentinel(Isolate* isolate); | 274 static inline Symbol* RawUninitializedSentinel(Isolate* isolate); |
279 | 275 |
280 static const int kDummyLoadICSlot = 0; | 276 static const int kDummyLoadICSlot = 0; |
281 static const int kDummyKeyedLoadICSlot = 2; | 277 static const int kDummyKeyedLoadICSlot = 2; |
282 static const int kDummyStoreICSlot = 4; | 278 static const int kDummyStoreICSlot = 4; |
283 static const int kDummyKeyedStoreICSlot = 6; | 279 static const int kDummyKeyedStoreICSlot = 6; |
284 | 280 |
285 static Handle<TypeFeedbackVector> DummyVector(Isolate* isolate); | 281 static Handle<TypeFeedbackVector> DummyVector(Isolate* isolate); |
286 static FeedbackVectorSlot DummySlot(int dummyIndex) { | |
287 DCHECK(dummyIndex >= 0 && dummyIndex <= kDummyKeyedStoreICSlot); | |
288 return FeedbackVectorSlot(dummyIndex); | |
289 } | |
290 | 282 |
291 private: | 283 private: |
292 void ClearSlotsImpl(SharedFunctionInfo* shared, bool force_clear); | 284 void ClearSlotsImpl(SharedFunctionInfo* shared, bool force_clear); |
293 | 285 |
294 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector); | 286 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector); |
295 }; | 287 }; |
296 | 288 |
297 | 289 |
298 // The following asserts protect an optimization in type feedback vector | 290 // The following asserts protect an optimization in type feedback vector |
299 // code that looks into the contents of a slot assuming to find a String, | 291 // code that looks into the contents of a slot assuming to find a String, |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 } | 667 } |
676 }; | 668 }; |
677 | 669 |
678 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); | 670 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); |
679 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); | 671 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); |
680 | 672 |
681 } // namespace internal | 673 } // namespace internal |
682 } // namespace v8 | 674 } // namespace v8 |
683 | 675 |
684 #endif // V8_TRANSITIONS_H_ | 676 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |