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 3298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3309 is_running_microtasks_ = true; | 3309 is_running_microtasks_ = true; |
3310 RunMicrotasksInternal(); | 3310 RunMicrotasksInternal(); |
3311 is_running_microtasks_ = false; | 3311 is_running_microtasks_ = false; |
3312 FireMicrotasksCompletedCallback(); | 3312 FireMicrotasksCompletedCallback(); |
3313 } | 3313 } |
3314 | 3314 |
3315 | 3315 |
3316 void Isolate::RunMicrotasksInternal() { | 3316 void Isolate::RunMicrotasksInternal() { |
3317 if (!pending_microtask_count()) return; | 3317 if (!pending_microtask_count()) return; |
3318 TRACE_EVENT0("v8.execute", "RunMicrotasks"); | 3318 TRACE_EVENT0("v8.execute", "RunMicrotasks"); |
| 3319 TRACE_EVENT_CALL_STATS_SCOPED(this, "v8", "V8.RunMicrotasks"); |
3319 while (pending_microtask_count() > 0) { | 3320 while (pending_microtask_count() > 0) { |
3320 HandleScope scope(this); | 3321 HandleScope scope(this); |
3321 int num_tasks = pending_microtask_count(); | 3322 int num_tasks = pending_microtask_count(); |
3322 Handle<FixedArray> queue(heap()->microtask_queue(), this); | 3323 Handle<FixedArray> queue(heap()->microtask_queue(), this); |
3323 DCHECK(num_tasks <= queue->length()); | 3324 DCHECK(num_tasks <= queue->length()); |
3324 set_pending_microtask_count(0); | 3325 set_pending_microtask_count(0); |
3325 heap()->set_microtask_queue(heap()->empty_fixed_array()); | 3326 heap()->set_microtask_queue(heap()->empty_fixed_array()); |
3326 | 3327 |
3327 Isolate* isolate = this; | 3328 Isolate* isolate = this; |
3328 FOR_WITH_HANDLE_SCOPE(isolate, int, i = 0, i, i < num_tasks, i++, { | 3329 FOR_WITH_HANDLE_SCOPE(isolate, int, i = 0, i, i < num_tasks, i++, { |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3585 // Then check whether this scope intercepts. | 3586 // Then check whether this scope intercepts. |
3586 if ((flag & intercept_mask_)) { | 3587 if ((flag & intercept_mask_)) { |
3587 intercepted_flags_ |= flag; | 3588 intercepted_flags_ |= flag; |
3588 return true; | 3589 return true; |
3589 } | 3590 } |
3590 return false; | 3591 return false; |
3591 } | 3592 } |
3592 | 3593 |
3593 } // namespace internal | 3594 } // namespace internal |
3594 } // namespace v8 | 3595 } // namespace v8 |
OLD | NEW |