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 "src/checks.h" | 8 #include "src/checks.h" |
9 #include "src/elements-kind.h" | 9 #include "src/elements-kind.h" |
10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 static inline Handle<Object> MonomorphicArraySentinel( | 42 static inline Handle<Object> MonomorphicArraySentinel( |
43 Isolate* isolate, ElementsKind elements_kind); | 43 Isolate* isolate, ElementsKind elements_kind); |
44 | 44 |
45 // A raw version of the uninitialized sentinel that's safe to read during | 45 // A raw version of the uninitialized sentinel that's safe to read during |
46 // garbage collection (e.g., for patching the cache). | 46 // garbage collection (e.g., for patching the cache). |
47 static inline Object* RawUninitializedSentinel(Heap* heap); | 47 static inline Object* RawUninitializedSentinel(Heap* heap); |
48 | 48 |
49 private: | 49 private: |
50 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector); | 50 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackVector); |
51 }; | 51 }; |
| 52 |
| 53 // A FeedbackNode is the combination of a TypeFeedbackVector and a slot. |
| 54 // Derived classes customize the update and retrieval of feedback. |
| 55 class FeedbackNode { |
| 56 public: |
| 57 FeedbackNode(Handle<TypeFeedbackVector> vector, int slot) |
| 58 : vector_(vector), slot_(slot) {} |
| 59 virtual ~FeedbackNode() {} |
| 60 |
| 61 Handle<TypeFeedbackVector> vector() const { return vector_; } |
| 62 int slot() const { return slot_; } |
| 63 |
| 64 private: |
| 65 Handle<TypeFeedbackVector> vector_; |
| 66 int slot_; |
| 67 }; |
| 68 |
| 69 |
| 70 bool operator==(FeedbackNode const&, FeedbackNode const&); |
| 71 bool operator!=(FeedbackNode const&, FeedbackNode const&); |
| 72 |
| 73 size_t hash_value(FeedbackNode const&); |
| 74 |
| 75 |
| 76 class LoadICFeedbackNode : public FeedbackNode { |
| 77 public: |
| 78 LoadICFeedbackNode(Handle<TypeFeedbackVector> vector, int slot) |
| 79 : FeedbackNode(vector, slot) {} |
| 80 }; |
| 81 |
| 82 |
| 83 class KeyedLoadICFeedbackNode : public FeedbackNode { |
| 84 public: |
| 85 KeyedLoadICFeedbackNode(Handle<TypeFeedbackVector> vector, int slot) |
| 86 : FeedbackNode(vector, slot) {} |
| 87 }; |
52 } | 88 } |
53 } // namespace v8::internal | 89 } // namespace v8::internal |
54 | 90 |
55 #endif // V8_TRANSITIONS_H_ | 91 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |