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/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 2656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2667 | 2667 |
2668 for (int i = 0; i < num_tasks; i++) { | 2668 for (int i = 0; i < num_tasks; i++) { |
2669 HandleScope scope(this); | 2669 HandleScope scope(this); |
2670 Handle<Object> microtask(queue->get(i), this); | 2670 Handle<Object> microtask(queue->get(i), this); |
2671 if (microtask->IsJSFunction()) { | 2671 if (microtask->IsJSFunction()) { |
2672 Handle<JSFunction> microtask_function = | 2672 Handle<JSFunction> microtask_function = |
2673 Handle<JSFunction>::cast(microtask); | 2673 Handle<JSFunction>::cast(microtask); |
2674 SaveContext save(this); | 2674 SaveContext save(this); |
2675 set_context(microtask_function->context()->native_context()); | 2675 set_context(microtask_function->context()->native_context()); |
2676 MaybeHandle<Object> maybe_exception; | 2676 MaybeHandle<Object> maybe_exception; |
2677 MaybeHandle<Object> result = | 2677 MaybeHandle<Object> result = Execution::TryCall( |
2678 Execution::TryCall(microtask_function, factory()->undefined_value(), | 2678 this, microtask_function, factory()->undefined_value(), 0, NULL, |
2679 0, NULL, &maybe_exception); | 2679 &maybe_exception); |
2680 // If execution is terminating, just bail out. | 2680 // If execution is terminating, just bail out. |
2681 Handle<Object> exception; | 2681 Handle<Object> exception; |
2682 if (result.is_null() && maybe_exception.is_null()) { | 2682 if (result.is_null() && maybe_exception.is_null()) { |
2683 // Clear out any remaining callbacks in the queue. | 2683 // Clear out any remaining callbacks in the queue. |
2684 heap()->set_microtask_queue(heap()->empty_fixed_array()); | 2684 heap()->set_microtask_queue(heap()->empty_fixed_array()); |
2685 set_pending_microtask_count(0); | 2685 set_pending_microtask_count(0); |
2686 return; | 2686 return; |
2687 } | 2687 } |
2688 } else { | 2688 } else { |
2689 Handle<CallHandlerInfo> callback_info = | 2689 Handle<CallHandlerInfo> callback_info = |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 // Then check whether this scope intercepts. | 2843 // Then check whether this scope intercepts. |
2844 if ((flag & intercept_mask_)) { | 2844 if ((flag & intercept_mask_)) { |
2845 intercepted_flags_ |= flag; | 2845 intercepted_flags_ |= flag; |
2846 return true; | 2846 return true; |
2847 } | 2847 } |
2848 return false; | 2848 return false; |
2849 } | 2849 } |
2850 | 2850 |
2851 } // namespace internal | 2851 } // namespace internal |
2852 } // namespace v8 | 2852 } // namespace v8 |
OLD | NEW |