| 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 inline Code* CallIC::get_host() { | 211 inline Code* IC::get_host() { |
| 212 return isolate() | 212 return isolate() |
| 213 ->inner_pointer_to_code_cache() | 213 ->inner_pointer_to_code_cache() |
| 214 ->GetCacheEntry(address()) | 214 ->GetCacheEntry(address()) |
| 215 ->code; | 215 ->code; |
| 216 } | 216 } |
| 217 | |
| 218 | |
| 219 // static | |
| 220 IC::State CallIC::FeedbackToState(Isolate* isolate, TypeFeedbackVector* vector, | |
| 221 FeedbackVectorICSlot slot) { | |
| 222 IC::State state = UNINITIALIZED; | |
| 223 Object* feedback = vector->Get(slot); | |
| 224 | |
| 225 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(isolate)) { | |
| 226 state = GENERIC; | |
| 227 } else if (feedback->IsAllocationSite() || feedback->IsJSFunction()) { | |
| 228 state = MONOMORPHIC; | |
| 229 } else { | |
| 230 CHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)); | |
| 231 } | |
| 232 | |
| 233 return state; | |
| 234 } | |
| 235 } | 217 } |
| 236 } // namespace v8::internal | 218 } // namespace v8::internal |
| 237 | 219 |
| 238 #endif // V8_IC_INL_H_ | 220 #endif // V8_IC_INL_H_ |
| OLD | NEW |