29 static void SetUpDefaultMicrotaskQueue(
Isolate* isolate);
30 static std::unique_ptr<MicrotaskQueue> New(
Isolate* isolate);
37 static Address CallEnqueueMicrotask(
Isolate* isolate,
38 intptr_t microtask_queue_pointer,
39 Address raw_microtask);
47 if (!ShouldPerfomCheckpoint())
return;
48 PerformCheckpointInternal(isolate);
52 return !IsRunningMicrotasks() && !GetMicrotasksScopeDepth() &&
53 !HasMicrotasksSuppressions();
57 void AddMicrotasksCompletedCallback(
59 void RemoveMicrotasksCompletedCallback(
66 int RunMicrotasks(
Isolate* isolate);
83 return microtasks_suppressions_ != 0;
89 void IncrementDebugMicrotasksScopeDepth() { ++debug_microtasks_depth_; }
90 void DecrementDebugMicrotasksScopeDepth() { --debug_microtasks_depth_; }
91 bool DebugMicrotasksScopeDepthIsZero()
const {
92 return debug_microtasks_depth_ == 0;
97 microtasks_policy_ = microtasks_policy;
119 void PerformCheckpointInternal(
v8::Isolate* v8_isolate);
121 void OnCompleted(
Isolate* isolate);
124 void ResizeBuffer(intptr_t new_capacity);
130 intptr_t capacity_ = 0;
132 Address* ring_buffer_ =
nullptr;
135 intptr_t finished_microtask_count_ = 0;
142 int microtasks_depth_ = 0;
143 int microtasks_suppressions_ = 0;
145 int debug_microtasks_depth_ = 0;
150 bool is_running_microtasks_ =
false;
151 bool is_running_completed_callbacks_ =
false;
153 std::pair<MicrotasksCompletedCallbackWithData, void*>;
155 std::optional<std::vector<CallbackWithData>>