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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 return AddSlot(FeedbackSlotKind::kStoreDataPropertyInLiteral); | 170 return AddSlot(FeedbackSlotKind::kStoreDataPropertyInLiteral); |
171 } | 171 } |
172 | 172 |
173 FeedbackSlot AddTypeProfileSlot(); | 173 FeedbackSlot AddTypeProfileSlot(); |
174 | 174 |
175 #ifdef OBJECT_PRINT | 175 #ifdef OBJECT_PRINT |
176 // For gdb debugging. | 176 // For gdb debugging. |
177 void Print(); | 177 void Print(); |
178 #endif // OBJECT_PRINT | 178 #endif // OBJECT_PRINT |
179 | 179 |
180 DECLARE_PRINTER(FeedbackVectorSpec) | 180 DECL_PRINTER(FeedbackVectorSpec) |
181 | 181 |
182 private: | 182 private: |
183 inline FeedbackSlot AddSlot(FeedbackSlotKind kind); | 183 inline FeedbackSlot AddSlot(FeedbackSlotKind kind); |
184 | 184 |
185 Derived* This() { return static_cast<Derived*>(this); } | 185 Derived* This() { return static_cast<Derived*>(this); } |
186 }; | 186 }; |
187 | 187 |
188 class StaticFeedbackVectorSpec | 188 class StaticFeedbackVectorSpec |
189 : public FeedbackVectorSpecBase<StaticFeedbackVectorSpec> { | 189 : public FeedbackVectorSpecBase<StaticFeedbackVectorSpec> { |
190 public: | 190 public: |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 FeedbackSlotKind GetKind(FeedbackSlot slot) const; | 268 FeedbackSlotKind GetKind(FeedbackSlot slot) const; |
269 | 269 |
270 template <typename Spec> | 270 template <typename Spec> |
271 static Handle<FeedbackMetadata> New(Isolate* isolate, const Spec* spec); | 271 static Handle<FeedbackMetadata> New(Isolate* isolate, const Spec* spec); |
272 | 272 |
273 #ifdef OBJECT_PRINT | 273 #ifdef OBJECT_PRINT |
274 // For gdb debugging. | 274 // For gdb debugging. |
275 void Print(); | 275 void Print(); |
276 #endif // OBJECT_PRINT | 276 #endif // OBJECT_PRINT |
277 | 277 |
278 DECLARE_PRINTER(FeedbackMetadata) | 278 DECL_PRINTER(FeedbackMetadata) |
279 | 279 |
280 static const char* Kind2String(FeedbackSlotKind kind); | 280 static const char* Kind2String(FeedbackSlotKind kind); |
281 bool HasTypeProfileSlot() const; | 281 bool HasTypeProfileSlot() const; |
282 | 282 |
283 private: | 283 private: |
284 static const int kFeedbackSlotKindBits = 5; | 284 static const int kFeedbackSlotKindBits = 5; |
285 STATIC_ASSERT(static_cast<int>(FeedbackSlotKind::kKindsNumber) < | 285 STATIC_ASSERT(static_cast<int>(FeedbackSlotKind::kKindsNumber) < |
286 (1 << kFeedbackSlotKindBits)); | 286 (1 << kFeedbackSlotKindBits)); |
287 | 287 |
288 void SetKind(FeedbackSlot slot, FeedbackSlotKind kind); | 288 void SetKind(FeedbackSlot slot, FeedbackSlotKind kind); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // Returns language mode encoded into kind of given slot. | 380 // Returns language mode encoded into kind of given slot. |
381 inline LanguageMode GetLanguageMode(FeedbackSlot slot) const { | 381 inline LanguageMode GetLanguageMode(FeedbackSlot slot) const { |
382 return GetLanguageModeFromSlotKind(GetKind(slot)); | 382 return GetLanguageModeFromSlotKind(GetKind(slot)); |
383 } | 383 } |
384 | 384 |
385 #ifdef OBJECT_PRINT | 385 #ifdef OBJECT_PRINT |
386 // For gdb debugging. | 386 // For gdb debugging. |
387 void Print(); | 387 void Print(); |
388 #endif // OBJECT_PRINT | 388 #endif // OBJECT_PRINT |
389 | 389 |
390 DECLARE_PRINTER(FeedbackVector) | 390 DECL_PRINTER(FeedbackVector) |
391 | 391 |
392 // Clears the vector slots. | 392 // Clears the vector slots. |
393 void ClearSlots(JSFunction* host_function); | 393 void ClearSlots(JSFunction* host_function); |
394 | 394 |
395 // The object that indicates an uninitialized cache. | 395 // The object that indicates an uninitialized cache. |
396 static inline Handle<Symbol> UninitializedSentinel(Isolate* isolate); | 396 static inline Handle<Symbol> UninitializedSentinel(Isolate* isolate); |
397 | 397 |
398 // The object that indicates a megamorphic state. | 398 // The object that indicates a megamorphic state. |
399 static inline Handle<Symbol> MegamorphicSentinel(Isolate* isolate); | 399 static inline Handle<Symbol> MegamorphicSentinel(Isolate* isolate); |
400 | 400 |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 InlineCacheState StateFromFeedback() const override; | 776 InlineCacheState StateFromFeedback() const override; |
777 }; | 777 }; |
778 | 778 |
779 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); | 779 inline BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback); |
780 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); | 780 inline CompareOperationHint CompareOperationHintFromFeedback(int type_feedback); |
781 | 781 |
782 } // namespace internal | 782 } // namespace internal |
783 } // namespace v8 | 783 } // namespace v8 |
784 | 784 |
785 #endif // V8_FEEDBACK_VECTOR_H_ | 785 #endif // V8_FEEDBACK_VECTOR_H_ |
OLD | NEW |