| 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/ic.h" | 8 #include "src/ic/ic.h" |
| 9 | 9 |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 JSFunction* builtin_ctor = GetRootConstructor(type, native_context); | 201 JSFunction* builtin_ctor = GetRootConstructor(type, native_context); |
| 202 if (builtin_ctor != NULL) { | 202 if (builtin_ctor != NULL) { |
| 203 *flag = kCacheOnPrototype; | 203 *flag = kCacheOnPrototype; |
| 204 return handle(builtin_ctor->initial_map()); | 204 return handle(builtin_ctor->initial_map()); |
| 205 } | 205 } |
| 206 *flag = kCacheOnReceiver; | 206 *flag = kCacheOnReceiver; |
| 207 return TypeToMap(type, isolate); | 207 return TypeToMap(type, isolate); |
| 208 } | 208 } |
| 209 | 209 |
| 210 | 210 |
| 211 IC::State CallIC::FeedbackToState(Handle<TypeFeedbackVector> vector, | 211 inline Code* CallIC::get_host() { |
| 212 Handle<Smi> slot) const { | 212 return isolate() |
| 213 ->inner_pointer_to_code_cache() |
| 214 ->GetCacheEntry(address()) |
| 215 ->code; |
| 216 } |
| 217 |
| 218 |
| 219 // static |
| 220 IC::State CallIC::FeedbackToState(Isolate* isolate, TypeFeedbackVector* vector, |
| 221 FeedbackVectorICSlot slot) { |
| 213 IC::State state = UNINITIALIZED; | 222 IC::State state = UNINITIALIZED; |
| 214 Object* feedback = vector->get(slot->value()); | 223 Object* feedback = vector->Get(slot); |
| 215 | 224 |
| 216 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate())) { | 225 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) { |
| 217 state = GENERIC; | 226 state = GENERIC; |
| 218 } else if (feedback->IsAllocationSite() || feedback->IsJSFunction()) { | 227 } else if (feedback->IsAllocationSite() || feedback->IsJSFunction()) { |
| 219 state = MONOMORPHIC; | 228 state = MONOMORPHIC; |
| 220 } else { | 229 } else { |
| 221 CHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate())); | 230 CHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)); |
| 222 } | 231 } |
| 223 | 232 |
| 224 return state; | 233 return state; |
| 225 } | 234 } |
| 226 } | 235 } |
| 227 } // namespace v8::internal | 236 } // namespace v8::internal |
| 228 | 237 |
| 229 #endif // V8_IC_INL_H_ | 238 #endif // V8_IC_INL_H_ |
| OLD | NEW |