| Index: src/isolate.cc
|
| diff --git a/src/isolate.cc b/src/isolate.cc
|
| index 7cf525d3e157a052dd78f21e25df1432518ee9c1..73d85ef0b5820796bc5329ebea1ee14dfcfb488e 100644
|
| --- a/src/isolate.cc
|
| +++ b/src/isolate.cc
|
| @@ -2313,9 +2313,11 @@ void Isolate::RunMicrotasks() {
|
| Handle<FixedArray> queue(heap()->microtask_queue(), this);
|
| DCHECK(num_tasks <= queue->length());
|
| set_pending_microtask_count(0);
|
| + set_running_microtask_count(num_tasks);
|
| heap()->set_microtask_queue(heap()->empty_fixed_array());
|
|
|
| for (int i = 0; i < num_tasks; i++) {
|
| + set_running_microtask_count(num_tasks - i - 1);
|
| HandleScope scope(this);
|
| Handle<Object> microtask(queue->get(i), this);
|
| if (microtask->IsJSFunction()) {
|
| @@ -2333,6 +2335,7 @@ void Isolate::RunMicrotasks() {
|
| // Clear out any remaining callbacks in the queue.
|
| heap()->set_microtask_queue(heap()->empty_fixed_array());
|
| set_pending_microtask_count(0);
|
| + set_running_microtask_count(0);
|
| return;
|
| }
|
| } else {
|
| @@ -2348,6 +2351,11 @@ void Isolate::RunMicrotasks() {
|
| }
|
|
|
|
|
| +bool Isolate::HasMoreMicrotasksToRun() const {
|
| + return pending_microtask_count() || running_microtask_count();
|
| +}
|
| +
|
| +
|
| void Isolate::SetUseCounterCallback(v8::Isolate::UseCounterCallback callback) {
|
| DCHECK(!use_counter_callback_);
|
| use_counter_callback_ = callback;
|
|
|