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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 DCHECK_NE(FeedbackVectorSlotKind::KINDS_NUMBER, kind); | 55 DCHECK_NE(FeedbackVectorSlotKind::KINDS_NUMBER, kind); |
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 return 1; | 59 return 1; |
60 } | 60 } |
61 | 61 |
62 return 2; | 62 return 2; |
63 } | 63 } |
64 | 64 |
65 bool TypeFeedbackMetadata::SlotRequiresName(FeedbackVectorSlotKind kind) { | |
66 switch (kind) { | |
67 case FeedbackVectorSlotKind::LOAD_GLOBAL_IC: | |
68 return true; | |
69 | |
70 case FeedbackVectorSlotKind::CALL_IC: | |
71 case FeedbackVectorSlotKind::LOAD_IC: | |
72 case FeedbackVectorSlotKind::KEYED_LOAD_IC: | |
73 case FeedbackVectorSlotKind::STORE_IC: | |
74 case FeedbackVectorSlotKind::KEYED_STORE_IC: | |
75 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: | |
76 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: | |
77 case FeedbackVectorSlotKind::GENERAL: | |
78 case FeedbackVectorSlotKind::INVALID: | |
79 return false; | |
80 | |
81 case FeedbackVectorSlotKind::KINDS_NUMBER: | |
82 break; | |
83 } | |
84 UNREACHABLE(); | |
85 return false; | |
86 } | |
87 | |
88 bool TypeFeedbackVector::is_empty() const { | 65 bool TypeFeedbackVector::is_empty() const { |
89 return length() == kReservedIndexCount; | 66 return length() == kReservedIndexCount; |
90 } | 67 } |
91 | 68 |
92 int TypeFeedbackVector::slot_count() const { | 69 int TypeFeedbackVector::slot_count() const { |
93 return length() - kReservedIndexCount; | 70 return length() - kReservedIndexCount; |
94 } | 71 } |
95 | 72 |
96 | 73 |
97 TypeFeedbackMetadata* TypeFeedbackVector::metadata() const { | 74 TypeFeedbackMetadata* TypeFeedbackVector::metadata() const { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 int index = vector()->GetIndex(slot()) + 1; | 269 int index = vector()->GetIndex(slot()) + 1; |
293 vector()->set(index, feedback_extra, mode); | 270 vector()->set(index, feedback_extra, mode); |
294 } | 271 } |
295 | 272 |
296 | 273 |
297 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } | 274 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } |
298 } // namespace internal | 275 } // namespace internal |
299 } // namespace v8 | 276 } // namespace v8 |
300 | 277 |
301 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ | 278 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
OLD | NEW |