| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/execution.h" | 5 #include "src/execution.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 Handle<Object> argv[], | 159 Handle<Object> argv[], |
| 160 bool convert_receiver) { | 160 bool convert_receiver) { |
| 161 if (!callable->IsJSFunction()) { | 161 if (!callable->IsJSFunction()) { |
| 162 ASSIGN_RETURN_ON_EXCEPTION( | 162 ASSIGN_RETURN_ON_EXCEPTION( |
| 163 isolate, callable, TryGetFunctionDelegate(isolate, callable), Object); | 163 isolate, callable, TryGetFunctionDelegate(isolate, callable), Object); |
| 164 } | 164 } |
| 165 Handle<JSFunction> func = Handle<JSFunction>::cast(callable); | 165 Handle<JSFunction> func = Handle<JSFunction>::cast(callable); |
| 166 | 166 |
| 167 // In sloppy mode, convert receiver. | 167 // In sloppy mode, convert receiver. |
| 168 if (convert_receiver && !receiver->IsJSReceiver() && | 168 if (convert_receiver && !receiver->IsJSReceiver() && |
| 169 !func->shared()->native() && | 169 !func->shared()->native() && is_sloppy(func->shared()->language_mode())) { |
| 170 func->shared()->strict_mode() == SLOPPY) { | |
| 171 if (receiver->IsUndefined() || receiver->IsNull()) { | 170 if (receiver->IsUndefined() || receiver->IsNull()) { |
| 172 receiver = handle(func->global_proxy()); | 171 receiver = handle(func->global_proxy()); |
| 173 DCHECK(!receiver->IsJSBuiltinsObject()); | 172 DCHECK(!receiver->IsJSBuiltinsObject()); |
| 174 } else { | 173 } else { |
| 175 ASSIGN_RETURN_ON_EXCEPTION( | 174 ASSIGN_RETURN_ON_EXCEPTION( |
| 176 isolate, receiver, ToObject(isolate, receiver), Object); | 175 isolate, receiver, ToObject(isolate, receiver), Object); |
| 177 } | 176 } |
| 178 } | 177 } |
| 179 | 178 |
| 180 return Invoke(false, func, receiver, argc, argv); | 179 return Invoke(false, func, receiver, argc, argv); |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 } | 744 } |
| 746 | 745 |
| 747 isolate_->counters()->stack_interrupts()->Increment(); | 746 isolate_->counters()->stack_interrupts()->Increment(); |
| 748 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 747 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
| 749 isolate_->runtime_profiler()->OptimizeNow(); | 748 isolate_->runtime_profiler()->OptimizeNow(); |
| 750 | 749 |
| 751 return isolate_->heap()->undefined_value(); | 750 return isolate_->heap()->undefined_value(); |
| 752 } | 751 } |
| 753 | 752 |
| 754 } } // namespace v8::internal | 753 } } // namespace v8::internal |
| OLD | NEW |