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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 | 116 |
117 | 117 |
118 void TypeFeedbackVector::Set(FeedbackVectorSlot slot, Object* value, | 118 void TypeFeedbackVector::Set(FeedbackVectorSlot slot, Object* value, |
119 WriteBarrierMode mode) { | 119 WriteBarrierMode mode) { |
120 set(GetIndex(slot), value, mode); | 120 set(GetIndex(slot), value, mode); |
121 } | 121 } |
122 | 122 |
123 // Helper function to transform the feedback to BinaryOperationHint. | 123 // Helper function to transform the feedback to BinaryOperationHint. |
124 BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback) { | 124 BinaryOperationHint BinaryOperationHintFromFeedback(int type_feedback) { |
125 switch (type_feedback) { | 125 switch (type_feedback) { |
126 case BinaryOperationFeedback::kNone: | |
127 return BinaryOperationHint::kNone; | |
mythria
2016/09/22 14:09:42
Benedikt, I updated this function to pass None fee
Benedikt Meurer
2016/09/23 03:34:38
Yeah, this seems reasonable, defaulting to any is
| |
126 case BinaryOperationFeedback::kSignedSmall: | 128 case BinaryOperationFeedback::kSignedSmall: |
127 return BinaryOperationHint::kSignedSmall; | 129 return BinaryOperationHint::kSignedSmall; |
128 case BinaryOperationFeedback::kNumber: | 130 case BinaryOperationFeedback::kNumber: |
129 return BinaryOperationHint::kNumberOrOddball; | 131 return BinaryOperationHint::kNumberOrOddball; |
130 case BinaryOperationFeedback::kAny: | 132 case BinaryOperationFeedback::kAny: |
131 default: | 133 default: |
132 return BinaryOperationHint::kAny; | 134 return BinaryOperationHint::kAny; |
133 } | 135 } |
134 UNREACHABLE(); | 136 UNREACHABLE(); |
135 return BinaryOperationHint::kNone; | 137 return BinaryOperationHint::kNone; |
136 } | 138 } |
137 | 139 |
138 // Helper function to transform the feedback to CompareOperationHint. | 140 // Helper function to transform the feedback to CompareOperationHint. |
139 CompareOperationHint CompareOperationHintFromFeedback(int type_feedback) { | 141 CompareOperationHint CompareOperationHintFromFeedback(int type_feedback) { |
140 switch (type_feedback) { | 142 switch (type_feedback) { |
143 case CompareOperationFeedback::kNone: | |
144 return CompareOperationHint::kNone; | |
141 case CompareOperationFeedback::kSignedSmall: | 145 case CompareOperationFeedback::kSignedSmall: |
142 return CompareOperationHint::kSignedSmall; | 146 return CompareOperationHint::kSignedSmall; |
143 case CompareOperationFeedback::kNumber: | 147 case CompareOperationFeedback::kNumber: |
144 return CompareOperationHint::kNumber; | 148 return CompareOperationHint::kNumber; |
145 default: | 149 default: |
146 return CompareOperationHint::kAny; | 150 return CompareOperationHint::kAny; |
147 } | 151 } |
152 UNREACHABLE(); | |
153 return CompareOperationHint::kNone; | |
148 } | 154 } |
149 | 155 |
150 void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic, | 156 void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic, |
151 bool code_is_interpreted) { | 157 bool code_is_interpreted) { |
152 Object* uninitialized_sentinel = | 158 Object* uninitialized_sentinel = |
153 TypeFeedbackVector::RawUninitializedSentinel(GetIsolate()); | 159 TypeFeedbackVector::RawUninitializedSentinel(GetIsolate()); |
154 Object* megamorphic_sentinel = | 160 Object* megamorphic_sentinel = |
155 *TypeFeedbackVector::MegamorphicSentinel(GetIsolate()); | 161 *TypeFeedbackVector::MegamorphicSentinel(GetIsolate()); |
156 int with = 0; | 162 int with = 0; |
157 int gen = 0; | 163 int gen = 0; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 int index = vector()->GetIndex(slot()) + 1; | 269 int index = vector()->GetIndex(slot()) + 1; |
264 vector()->set(index, feedback_extra, mode); | 270 vector()->set(index, feedback_extra, mode); |
265 } | 271 } |
266 | 272 |
267 | 273 |
268 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } | 274 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } |
269 } // namespace internal | 275 } // namespace internal |
270 } // namespace v8 | 276 } // namespace v8 |
271 | 277 |
272 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ | 278 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ |
OLD | NEW |