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_IC_INL_H_ | 5 #ifndef V8_IC_INL_H_ |
6 #define V8_IC_INL_H_ | 6 #define V8_IC_INL_H_ |
7 | 7 |
8 #include "src/ic.h" | 8 #include "src/ic.h" |
9 | 9 |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 JSFunction* builtin_ctor = GetRootConstructor(type, native_context); | 162 JSFunction* builtin_ctor = GetRootConstructor(type, native_context); |
163 if (builtin_ctor != NULL) { | 163 if (builtin_ctor != NULL) { |
164 *flag = kCacheOnPrototype; | 164 *flag = kCacheOnPrototype; |
165 return handle(builtin_ctor->initial_map()); | 165 return handle(builtin_ctor->initial_map()); |
166 } | 166 } |
167 *flag = kCacheOnReceiver; | 167 *flag = kCacheOnReceiver; |
168 return TypeToMap(type, isolate); | 168 return TypeToMap(type, isolate); |
169 } | 169 } |
170 | 170 |
171 | 171 |
172 IC::State CallIC::FeedbackObjectToState(Object* feedback) const { | 172 IC::State CallIC::FeedbackToState(Handle<FixedArray> vector, |
| 173 Handle<Smi> slot) const { |
173 IC::State state = UNINITIALIZED; | 174 IC::State state = UNINITIALIZED; |
| 175 Object* feedback = vector->get(slot->value()); |
174 | 176 |
175 if (feedback == *TypeFeedbackInfo::MegamorphicSentinel(isolate())) { | 177 if (feedback == *TypeFeedbackInfo::MegamorphicSentinel(isolate())) { |
176 state = GENERIC; | 178 state = GENERIC; |
177 } else if (feedback->IsAllocationSite() || feedback->IsJSFunction()) { | 179 } else if (feedback->IsAllocationSite() || feedback->IsJSFunction()) { |
178 state = MONOMORPHIC; | 180 state = MONOMORPHIC; |
179 } else { | 181 } else { |
180 CHECK(feedback == *TypeFeedbackInfo::UninitializedSentinel(isolate())); | 182 CHECK(feedback == *TypeFeedbackInfo::UninitializedSentinel(isolate())); |
181 } | 183 } |
182 | 184 |
183 return state; | 185 return state; |
184 } | 186 } |
185 } } // namespace v8::internal | 187 } } // namespace v8::internal |
186 | 188 |
187 #endif // V8_IC_INL_H_ | 189 #endif // V8_IC_INL_H_ |
OLD | NEW |