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 3266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3277 void Isolate::FireCallCompletedCallback() { | 3277 void Isolate::FireCallCompletedCallback() { |
3278 if (!handle_scope_implementer()->CallDepthIsZero()) return; | 3278 if (!handle_scope_implementer()->CallDepthIsZero()) return; |
3279 | 3279 |
3280 bool run_microtasks = | 3280 bool run_microtasks = |
3281 pending_microtask_count() && | 3281 pending_microtask_count() && |
3282 !handle_scope_implementer()->HasMicrotasksSuppressions() && | 3282 !handle_scope_implementer()->HasMicrotasksSuppressions() && |
3283 handle_scope_implementer()->microtasks_policy() == | 3283 handle_scope_implementer()->microtasks_policy() == |
3284 v8::MicrotasksPolicy::kAuto; | 3284 v8::MicrotasksPolicy::kAuto; |
3285 | 3285 |
3286 if (run_microtasks) RunMicrotasks(); | 3286 if (run_microtasks) RunMicrotasks(); |
3287 // Prevent stepping from spilling into the next call made by the embedder. | 3287 if (debug()->is_active()) debug()->HandleCallCompleted(); |
3288 if (debug()->is_active()) debug()->ClearStepping(); | |
3289 | 3288 |
3290 if (call_completed_callbacks_.is_empty()) return; | 3289 if (call_completed_callbacks_.is_empty()) return; |
3291 // Fire callbacks. Increase call depth to prevent recursive callbacks. | 3290 // Fire callbacks. Increase call depth to prevent recursive callbacks. |
3292 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(this); | 3291 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(this); |
3293 v8::Isolate::SuppressMicrotaskExecutionScope suppress(isolate); | 3292 v8::Isolate::SuppressMicrotaskExecutionScope suppress(isolate); |
3294 for (int i = 0; i < call_completed_callbacks_.length(); i++) { | 3293 for (int i = 0; i < call_completed_callbacks_.length(); i++) { |
3295 call_completed_callbacks_.at(i)(isolate); | 3294 call_completed_callbacks_.at(i)(isolate); |
3296 } | 3295 } |
3297 } | 3296 } |
3298 | 3297 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3698 // Then check whether this scope intercepts. | 3697 // Then check whether this scope intercepts. |
3699 if ((flag & intercept_mask_)) { | 3698 if ((flag & intercept_mask_)) { |
3700 intercepted_flags_ |= flag; | 3699 intercepted_flags_ |= flag; |
3701 return true; | 3700 return true; |
3702 } | 3701 } |
3703 return false; | 3702 return false; |
3704 } | 3703 } |
3705 | 3704 |
3706 } // namespace internal | 3705 } // namespace internal |
3707 } // namespace v8 | 3706 } // namespace v8 |
OLD | NEW |