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/ic/ic.h" | 5 #include "src/ic/ic.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/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2303 nexus->ConfigureMegamorphic(); | 2303 nexus->ConfigureMegamorphic(); |
2304 } else { | 2304 } else { |
2305 DCHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate())); | 2305 DCHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate())); |
2306 Handle<JSFunction> js_function = Handle<JSFunction>::cast(function); | 2306 Handle<JSFunction> js_function = Handle<JSFunction>::cast(function); |
2307 | 2307 |
2308 Handle<JSFunction> array_function = | 2308 Handle<JSFunction> array_function = |
2309 Handle<JSFunction>(isolate()->native_context()->array_function()); | 2309 Handle<JSFunction>(isolate()->native_context()->array_function()); |
2310 if (array_function.is_identical_to(js_function)) { | 2310 if (array_function.is_identical_to(js_function)) { |
2311 // Alter the slot. | 2311 // Alter the slot. |
2312 nexus->ConfigureMonomorphicArray(); | 2312 nexus->ConfigureMonomorphicArray(); |
| 2313 } else if (js_function->context()->native_context() != |
| 2314 *isolate()->native_context()) { |
| 2315 // Don't collect cross-native context feedback for the CallIC. |
| 2316 // TODO(bmeurer): We should collect the SharedFunctionInfo as |
| 2317 // feedback in this case instead. |
| 2318 nexus->ConfigureMegamorphic(); |
2313 } else { | 2319 } else { |
2314 nexus->ConfigureMonomorphic(js_function); | 2320 nexus->ConfigureMonomorphic(js_function); |
2315 } | 2321 } |
2316 } | 2322 } |
2317 | 2323 |
2318 if (function->IsJSFunction()) { | 2324 if (function->IsJSFunction()) { |
2319 Handle<JSFunction> js_function = Handle<JSFunction>::cast(function); | 2325 Handle<JSFunction> js_function = Handle<JSFunction>::cast(function); |
2320 name = handle(js_function->shared()->name(), isolate()); | 2326 name = handle(js_function->shared()->name(), isolate()); |
2321 } | 2327 } |
2322 | 2328 |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3139 KeyedLoadICNexus nexus(vector, vector_slot); | 3145 KeyedLoadICNexus nexus(vector, vector_slot); |
3140 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3146 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3141 ic.UpdateState(receiver, key); | 3147 ic.UpdateState(receiver, key); |
3142 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 3148 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
3143 } | 3149 } |
3144 | 3150 |
3145 return *result; | 3151 return *result; |
3146 } | 3152 } |
3147 } // namespace internal | 3153 } // namespace internal |
3148 } // namespace v8 | 3154 } // namespace v8 |
OLD | NEW |