| 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/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 #include "src/messages.h" | 10 #include "src/messages.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return Handle<Object>(value, isolate); | 133 return Handle<Object>(value, isolate); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace | 136 } // namespace |
| 137 | 137 |
| 138 | 138 |
| 139 // static | 139 // static |
| 140 MaybeHandle<Object> Execution::Call(Isolate* isolate, Handle<Object> callable, | 140 MaybeHandle<Object> Execution::Call(Isolate* isolate, Handle<Object> callable, |
| 141 Handle<Object> receiver, int argc, | 141 Handle<Object> receiver, int argc, |
| 142 Handle<Object> argv[]) { | 142 Handle<Object> argv[]) { |
| 143 CHECK(!isolate->has_scheduled_exception()); |
| 143 // Convert calls on global objects to be calls on the global | 144 // Convert calls on global objects to be calls on the global |
| 144 // receiver instead to avoid having a 'this' pointer which refers | 145 // receiver instead to avoid having a 'this' pointer which refers |
| 145 // directly to a global object. | 146 // directly to a global object. |
| 146 if (receiver->IsJSGlobalObject()) { | 147 if (receiver->IsJSGlobalObject()) { |
| 147 receiver = | 148 receiver = |
| 148 handle(Handle<JSGlobalObject>::cast(receiver)->global_proxy(), isolate); | 149 handle(Handle<JSGlobalObject>::cast(receiver)->global_proxy(), isolate); |
| 149 } | 150 } |
| 150 | 151 |
| 151 // api callbacks can be called directly. | 152 // api callbacks can be called directly. |
| 152 if (callable->IsJSFunction() && | 153 if (callable->IsJSFunction() && |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 495 |
| 495 isolate_->counters()->stack_interrupts()->Increment(); | 496 isolate_->counters()->stack_interrupts()->Increment(); |
| 496 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 497 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
| 497 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); | 498 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); |
| 498 | 499 |
| 499 return isolate_->heap()->undefined_value(); | 500 return isolate_->heap()->undefined_value(); |
| 500 } | 501 } |
| 501 | 502 |
| 502 } // namespace internal | 503 } // namespace internal |
| 503 } // namespace v8 | 504 } // namespace v8 |
| OLD | NEW |