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_FEEDBACK_VECTOR_H_ | 5 #ifndef V8_FEEDBACK_VECTOR_H_ |
6 #define V8_FEEDBACK_VECTOR_H_ | 6 #define V8_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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 int* vector_ic_count, bool code_is_interpreted); | 274 int* vector_ic_count, bool code_is_interpreted); |
275 | 275 |
276 inline bool is_empty() const; | 276 inline bool is_empty() const; |
277 | 277 |
278 // Returns number of slots in the vector. | 278 // Returns number of slots in the vector. |
279 inline int slot_count() const; | 279 inline int slot_count() const; |
280 | 280 |
281 inline FeedbackMetadata* metadata() const; | 281 inline FeedbackMetadata* metadata() const; |
282 inline SharedFunctionInfo* shared_function_info() const; | 282 inline SharedFunctionInfo* shared_function_info() const; |
283 inline int invocation_count() const; | 283 inline int invocation_count() const; |
| 284 inline void clear_invocation_count(); |
284 | 285 |
285 // Conversion from a slot to an integer index to the underlying array. | 286 // Conversion from a slot to an integer index to the underlying array. |
286 static int GetIndex(FeedbackSlot slot) { | 287 static int GetIndex(FeedbackSlot slot) { |
287 return kReservedIndexCount + slot.ToInt(); | 288 return kReservedIndexCount + slot.ToInt(); |
288 } | 289 } |
289 | 290 |
290 // Conversion from an integer index to the underlying array to a slot. | 291 // Conversion from an integer index to the underlying array to a slot. |
291 static inline FeedbackSlot ToSlot(int index); | 292 static inline FeedbackSlot ToSlot(int index); |
292 inline Object* Get(FeedbackSlot slot) const; | 293 inline Object* Get(FeedbackSlot slot) const; |
293 inline void Set(FeedbackSlot slot, Object* value, | 294 inline void Set(FeedbackSlot slot, Object* value, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 346 |
346 // The object that indicates a premonomorphic state. | 347 // The object that indicates a premonomorphic state. |
347 static inline Handle<Symbol> PremonomorphicSentinel(Isolate* isolate); | 348 static inline Handle<Symbol> PremonomorphicSentinel(Isolate* isolate); |
348 | 349 |
349 // A raw version of the uninitialized sentinel that's safe to read during | 350 // A raw version of the uninitialized sentinel that's safe to read during |
350 // garbage collection (e.g., for patching the cache). | 351 // garbage collection (e.g., for patching the cache). |
351 static inline Symbol* RawUninitializedSentinel(Isolate* isolate); | 352 static inline Symbol* RawUninitializedSentinel(Isolate* isolate); |
352 | 353 |
353 private: | 354 private: |
354 void ClearSlotsImpl(SharedFunctionInfo* shared, bool force_clear); | 355 void ClearSlotsImpl(SharedFunctionInfo* shared, bool force_clear); |
| 356 static void AddToCodeCoverageList(Isolate* isolate, |
| 357 Handle<FeedbackVector> vector); |
355 | 358 |
356 DISALLOW_IMPLICIT_CONSTRUCTORS(FeedbackVector); | 359 DISALLOW_IMPLICIT_CONSTRUCTORS(FeedbackVector); |
357 }; | 360 }; |
358 | 361 |
359 // The following asserts protect an optimization in type feedback vector | 362 // The following asserts protect an optimization in type feedback vector |
360 // code that looks into the contents of a slot assuming to find a String, | 363 // code that looks into the contents of a slot assuming to find a String, |
361 // a Symbol, an AllocationSite, a WeakCell, or a FixedArray. | 364 // a Symbol, an AllocationSite, a WeakCell, or a FixedArray. |
362 STATIC_ASSERT(WeakCell::kSize >= 2 * kPointerSize); | 365 STATIC_ASSERT(WeakCell::kSize >= 2 * kPointerSize); |
363 STATIC_ASSERT(WeakCell::kValueOffset == AllocationSite::kTransitionInfoOffset); | 366 STATIC_ASSERT(WeakCell::kValueOffset == AllocationSite::kTransitionInfoOffset); |
364 STATIC_ASSERT(WeakCell::kValueOffset == FixedArray::kLengthOffset); | 367 STATIC_ASSERT(WeakCell::kValueOffset == FixedArray::kLengthOffset); |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 InlineCacheState StateFromFeedback() const override; | 735 InlineCacheState StateFromFeedback() const override; |
733 }; | 736 }; |
734 | 737 |
735 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); | 738 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); |
736 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); | 739 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); |
737 | 740 |
738 } // namespace internal | 741 } // namespace internal |
739 } // namespace v8 | 742 } // namespace v8 |
740 | 743 |
741 #endif // V8_FEEDBACK_VECTOR_H_ | 744 #endif // V8_FEEDBACK_VECTOR_H_ |
OLD | NEW |