| 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 handle(Handle<JSGlobalObject>::cast(receiver)->global_proxy(), isolate); | 133 handle(Handle<JSGlobalObject>::cast(receiver)->global_proxy(), isolate); |
| 134 } | 134 } |
| 135 | 135 |
| 136 // api callbacks can be called directly. | 136 // api callbacks can be called directly. |
| 137 if (callable->IsJSFunction() && | 137 if (callable->IsJSFunction() && |
| 138 Handle<JSFunction>::cast(callable)->shared()->IsApiFunction()) { | 138 Handle<JSFunction>::cast(callable)->shared()->IsApiFunction()) { |
| 139 Handle<JSFunction> function = Handle<JSFunction>::cast(callable); | 139 Handle<JSFunction> function = Handle<JSFunction>::cast(callable); |
| 140 SaveContext save(isolate); | 140 SaveContext save(isolate); |
| 141 isolate->set_context(function->context()); | 141 isolate->set_context(function->context()); |
| 142 DCHECK(function->context()->global_object()->IsJSGlobalObject()); | 142 DCHECK(function->context()->global_object()->IsJSGlobalObject()); |
| 143 auto value = Builtins::InvokeApiFunction(function, receiver, argc, argv); | 143 auto value = |
| 144 Builtins::InvokeApiFunction(isolate, function, receiver, argc, argv); |
| 144 bool has_exception = value.is_null(); | 145 bool has_exception = value.is_null(); |
| 145 DCHECK(has_exception == isolate->has_pending_exception()); | 146 DCHECK(has_exception == isolate->has_pending_exception()); |
| 146 if (has_exception) { | 147 if (has_exception) { |
| 147 isolate->ReportPendingMessages(); | 148 isolate->ReportPendingMessages(); |
| 148 return MaybeHandle<Object>(); | 149 return MaybeHandle<Object>(); |
| 149 } else { | 150 } else { |
| 150 isolate->clear_pending_message(); | 151 isolate->clear_pending_message(); |
| 151 } | 152 } |
| 152 return value; | 153 return value; |
| 153 } | 154 } |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 472 |
| 472 isolate_->counters()->stack_interrupts()->Increment(); | 473 isolate_->counters()->stack_interrupts()->Increment(); |
| 473 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 474 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
| 474 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); | 475 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); |
| 475 | 476 |
| 476 return isolate_->heap()->undefined_value(); | 477 return isolate_->heap()->undefined_value(); |
| 477 } | 478 } |
| 478 | 479 |
| 479 } // namespace internal | 480 } // namespace internal |
| 480 } // namespace v8 | 481 } // namespace v8 |
| OLD | NEW |