| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() && |
| 170 func->shared()->strict_mode() == SLOPPY) { | 170 !is_strict(func->shared()->language_mode())) { |
| 171 if (receiver->IsUndefined() || receiver->IsNull()) { | 171 if (receiver->IsUndefined() || receiver->IsNull()) { |
| 172 receiver = handle(func->global_proxy()); | 172 receiver = handle(func->global_proxy()); |
| 173 DCHECK(!receiver->IsJSBuiltinsObject()); | 173 DCHECK(!receiver->IsJSBuiltinsObject()); |
| 174 } else { | 174 } else { |
| 175 ASSIGN_RETURN_ON_EXCEPTION( | 175 ASSIGN_RETURN_ON_EXCEPTION( |
| 176 isolate, receiver, ToObject(isolate, receiver), Object); | 176 isolate, receiver, ToObject(isolate, receiver), Object); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 return Invoke(false, func, receiver, argc, argv); | 180 return Invoke(false, func, receiver, argc, argv); |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 } | 745 } |
| 746 | 746 |
| 747 isolate_->counters()->stack_interrupts()->Increment(); | 747 isolate_->counters()->stack_interrupts()->Increment(); |
| 748 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 748 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
| 749 isolate_->runtime_profiler()->OptimizeNow(); | 749 isolate_->runtime_profiler()->OptimizeNow(); |
| 750 | 750 |
| 751 return isolate_->heap()->undefined_value(); | 751 return isolate_->heap()->undefined_value(); |
| 752 } | 752 } |
| 753 | 753 |
| 754 } } // namespace v8::internal | 754 } } // namespace v8::internal |
| OLD | NEW |