OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_INL_H_ | 5 #ifndef V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
6 #define V8_TYPE_FEEDBACK_VECTOR_INL_H_ | 6 #define V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
7 | 7 |
8 #include "src/globals.h" | 8 #include "src/globals.h" |
9 #include "src/type-feedback-vector.h" | 9 #include "src/type-feedback-vector.h" |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (kind == FeedbackVectorSlotKind::GENERAL || | 56 if (kind == FeedbackVectorSlotKind::GENERAL || |
57 kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC || | 57 kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC || |
58 kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC || | 58 kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC || |
59 kind == FeedbackVectorSlotKind::CREATE_CLOSURE) { | 59 kind == FeedbackVectorSlotKind::CREATE_CLOSURE) { |
60 return 1; | 60 return 1; |
61 } | 61 } |
62 | 62 |
63 return 2; | 63 return 2; |
64 } | 64 } |
65 | 65 |
66 bool TypeFeedbackMetadata::SlotRequiresParameter(FeedbackVectorSlotKind kind) { | |
67 switch (kind) { | |
68 case FeedbackVectorSlotKind::CREATE_CLOSURE: | |
69 return true; | |
70 | |
71 case FeedbackVectorSlotKind::CALL_IC: | |
72 case FeedbackVectorSlotKind::LOAD_IC: | |
73 case FeedbackVectorSlotKind::LOAD_GLOBAL_IC: | |
74 case FeedbackVectorSlotKind::KEYED_LOAD_IC: | |
75 case FeedbackVectorSlotKind::STORE_IC: | |
76 case FeedbackVectorSlotKind::KEYED_STORE_IC: | |
77 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: | |
78 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: | |
79 case FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: | |
80 case FeedbackVectorSlotKind::GENERAL: | |
81 case FeedbackVectorSlotKind::INVALID: | |
82 return false; | |
83 | |
84 case FeedbackVectorSlotKind::KINDS_NUMBER: | |
85 break; | |
86 } | |
87 UNREACHABLE(); | |
88 return false; | |
89 } | |
90 | |
91 bool TypeFeedbackVector::is_empty() const { | 66 bool TypeFeedbackVector::is_empty() const { |
92 return length() == kReservedIndexCount; | 67 return length() == kReservedIndexCount; |
93 } | 68 } |
94 | 69 |
95 int TypeFeedbackVector::slot_count() const { | 70 int TypeFeedbackVector::slot_count() const { |
96 return length() - kReservedIndexCount; | 71 return length() - kReservedIndexCount; |
97 } | 72 } |
98 | 73 |
99 | 74 |
100 TypeFeedbackMetadata* TypeFeedbackVector::metadata() const { | 75 TypeFeedbackMetadata* TypeFeedbackVector::metadata() const { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 int index = vector()->GetIndex(slot()) + 1; | 276 int index = vector()->GetIndex(slot()) + 1; |
302 vector()->set(index, feedback_extra, mode); | 277 vector()->set(index, feedback_extra, mode); |
303 } | 278 } |
304 | 279 |
305 | 280 |
306 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } | 281 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } |
307 } // namespace internal | 282 } // namespace internal |
308 } // namespace v8 | 283 } // namespace v8 |
309 | 284 |
310 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ | 285 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
OLD | NEW |