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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 Context* native_context = *isolate->native_context(); | 161 Context* native_context = *isolate->native_context(); |
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 |
| 172 IC::State CallIC::FeedbackObjectToState(Object* feedback) const { |
| 173 IC::State state = UNINITIALIZED; |
| 174 |
| 175 if (feedback == *TypeFeedbackInfo::MegamorphicSentinel(isolate())) { |
| 176 state = GENERIC; |
| 177 } else if (feedback->IsAllocationSite() || feedback->IsJSFunction()) { |
| 178 state = MONOMORPHIC; |
| 179 } else { |
| 180 CHECK(feedback == *TypeFeedbackInfo::UninitializedSentinel(isolate())); |
| 181 } |
| 182 |
| 183 return state; |
| 184 } |
171 } } // namespace v8::internal | 185 } } // namespace v8::internal |
172 | 186 |
173 #endif // V8_IC_INL_H_ | 187 #endif // V8_IC_INL_H_ |
OLD | NEW |