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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
11 #include "src/conversions.h" | 11 #include "src/conversions.h" |
12 #include "src/execution.h" | 12 #include "src/execution.h" |
13 #include "src/ic-inl.h" | 13 #include "src/ic-inl.h" |
| 14 #include "src/prototype.h" |
14 #include "src/runtime.h" | 15 #include "src/runtime.h" |
15 #include "src/stub-cache.h" | 16 #include "src/stub-cache.h" |
16 | 17 |
17 namespace v8 { | 18 namespace v8 { |
18 namespace internal { | 19 namespace internal { |
19 | 20 |
20 char IC::TransitionMarkFromState(IC::State state) { | 21 char IC::TransitionMarkFromState(IC::State state) { |
21 switch (state) { | 22 switch (state) { |
22 case UNINITIALIZED: return '0'; | 23 case UNINITIALIZED: return '0'; |
23 case PREMONOMORPHIC: return '.'; | 24 case PREMONOMORPHIC: return '.'; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 Code::ExtractCacheHolderFromFlags(target()->flags()); | 242 Code::ExtractCacheHolderFromFlags(target()->flags()); |
242 | 243 |
243 switch (cache_holder) { | 244 switch (cache_holder) { |
244 case OWN_MAP: | 245 case OWN_MAP: |
245 // The stub was generated for JSObject but called for non-JSObject. | 246 // The stub was generated for JSObject but called for non-JSObject. |
246 // IC::GetCodeCacheHolder is not applicable. | 247 // IC::GetCodeCacheHolder is not applicable. |
247 if (!receiver->IsJSObject()) return false; | 248 if (!receiver->IsJSObject()) return false; |
248 break; | 249 break; |
249 case PROTOTYPE_MAP: | 250 case PROTOTYPE_MAP: |
250 // IC::GetCodeCacheHolder is not applicable. | 251 // IC::GetCodeCacheHolder is not applicable. |
251 if (receiver->GetPrototype(isolate())->IsNull()) return false; | 252 PrototypeIterator iter(isolate(), receiver); |
| 253 if (iter.IsAtEnd()) return false; |
252 break; | 254 break; |
253 } | 255 } |
254 | 256 |
255 Handle<Map> map( | 257 Handle<Map> map( |
256 IC::GetCodeCacheHolder(isolate(), *receiver, cache_holder)->map()); | 258 IC::GetCodeCacheHolder(isolate(), *receiver, cache_holder)->map()); |
257 | 259 |
258 // Decide whether the inline cache failed because of changes to the | 260 // Decide whether the inline cache failed because of changes to the |
259 // receiver itself or changes to one of its prototypes. | 261 // receiver itself or changes to one of its prototypes. |
260 // | 262 // |
261 // If there are changes to the receiver itself, the map of the | 263 // If there are changes to the receiver itself, the map of the |
(...skipping 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 #undef ADDR | 3099 #undef ADDR |
3098 }; | 3100 }; |
3099 | 3101 |
3100 | 3102 |
3101 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3103 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3102 return IC_utilities[id]; | 3104 return IC_utilities[id]; |
3103 } | 3105 } |
3104 | 3106 |
3105 | 3107 |
3106 } } // namespace v8::internal | 3108 } } // namespace v8::internal |
OLD | NEW |