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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 typedef BitSetComputer<FeedbackVectorSlotKind, kFeedbackVectorSlotKindBits, | 216 typedef BitSetComputer<FeedbackVectorSlotKind, kFeedbackVectorSlotKindBits, |
217 kSmiValueSize, uint32_t> VectorICComputer; | 217 kSmiValueSize, uint32_t> VectorICComputer; |
218 | 218 |
219 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackMetadata); | 219 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackMetadata); |
220 }; | 220 }; |
221 | 221 |
222 | 222 |
223 // The shape of the TypeFeedbackVector is an array with: | 223 // The shape of the TypeFeedbackVector is an array with: |
224 // 0: feedback metadata | 224 // 0: feedback metadata |
225 // 1: feedback slot #0 | 225 // 1: invocation count |
| 226 // 2: feedback slot #0 |
226 // ... | 227 // ... |
227 // 1 + slot_count - 1: feedback slot #(slot_count-1) | 228 // 2 + slot_count - 1: feedback slot #(slot_count-1) |
228 // | 229 // |
229 class TypeFeedbackVector : public FixedArray { | 230 class TypeFeedbackVector : public FixedArray { |
230 public: | 231 public: |
231 // Casting. | 232 // Casting. |
232 static inline TypeFeedbackVector* cast(Object* obj); | 233 static inline TypeFeedbackVector* cast(Object* obj); |
233 | 234 |
234 static const int kMetadataIndex = 0; | 235 static const int kMetadataIndex = 0; |
235 static const int kReservedIndexCount = 1; | 236 static const int kInvocationCountIndex = 1; |
| 237 static const int kReservedIndexCount = 2; |
236 | 238 |
237 inline void ComputeCounts(int* with_type_info, int* generic); | 239 inline void ComputeCounts(int* with_type_info, int* generic); |
238 | 240 |
239 inline bool is_empty() const; | 241 inline bool is_empty() const; |
240 | 242 |
241 // Returns number of slots in the vector. | 243 // Returns number of slots in the vector. |
242 inline int slot_count() const; | 244 inline int slot_count() const; |
243 | 245 |
244 inline TypeFeedbackMetadata* metadata() const; | 246 inline TypeFeedbackMetadata* metadata() const; |
| 247 inline int invocation_count() const; |
245 | 248 |
246 // Conversion from a slot to an integer index to the underlying array. | 249 // Conversion from a slot to an integer index to the underlying array. |
247 static int GetIndex(FeedbackVectorSlot slot) { | 250 static int GetIndex(FeedbackVectorSlot slot) { |
248 return kReservedIndexCount + slot.ToInt(); | 251 return kReservedIndexCount + slot.ToInt(); |
249 } | 252 } |
250 static int GetIndexFromSpec(const FeedbackVectorSpec* spec, | 253 static int GetIndexFromSpec(const FeedbackVectorSpec* spec, |
251 FeedbackVectorSlot slot); | 254 FeedbackVectorSlot slot); |
252 | 255 |
253 // Conversion from an integer index to the underlying array to a slot. | 256 // Conversion from an integer index to the underlying array to a slot. |
254 static inline FeedbackVectorSlot ToSlot(int index); | 257 static inline FeedbackVectorSlot ToSlot(int index); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 KeyedAccessStoreMode GetKeyedAccessStoreMode() const; | 629 KeyedAccessStoreMode GetKeyedAccessStoreMode() const; |
627 IcCheckType GetKeyType() const; | 630 IcCheckType GetKeyType() const; |
628 | 631 |
629 InlineCacheState StateFromFeedback() const override; | 632 InlineCacheState StateFromFeedback() const override; |
630 Name* FindFirstName() const override; | 633 Name* FindFirstName() const override; |
631 }; | 634 }; |
632 } // namespace internal | 635 } // namespace internal |
633 } // namespace v8 | 636 } // namespace v8 |
634 | 637 |
635 #endif // V8_TRANSITIONS_H_ | 638 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |