diff --git a/include/v8-platform.h b/include/v8-platform.h index 32898e7ef9..1ab9c454f6 100644 --- a/include/v8-platform.h +++ b/include/v8-platform.h @@ -149,6 +149,8 @@ class TaskRunner { TaskRunner(const TaskRunner&) = delete; TaskRunner& operator=(const TaskRunner&) = delete; + + virtual void PostSignalTask(std::unique_ptr task) = 0; }; /** diff --git a/src/heap/collection-barrier.cc b/src/heap/collection-barrier.cc index 9486c234b0..65d1eb5645 100644 --- a/src/heap/collection-barrier.cc +++ b/src/heap/collection-barrier.cc @@ -116,7 +116,7 @@ void CollectionBarrier::ActivateStackGuardAndPostTask() { V8::GetCurrentPlatform() ->GetForegroundTaskRunner(reinterpret_cast(isolate)) - ->PostTask(std::make_unique(heap_)); + ->PostSignalTask(std::make_unique(heap_)); } void CollectionBarrier::StopTimeToCollectionTimer() { diff --git a/src/heap/heap.cc b/src/heap/heap.cc index 8911bd96c3..c58fbee30f 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc @@ -4114,7 +4114,7 @@ void Heap::MemoryPressureNotification(MemoryPressureLevel level, isolate()->stack_guard()->RequestGC(); auto taskrunner = V8::GetCurrentPlatform()->GetForegroundTaskRunner( reinterpret_cast(isolate())); - taskrunner->PostTask(std::make_unique(this)); + taskrunner->PostSignalTask(std::make_unique(this)); } } } diff --git a/src/heap/safepoint.cc b/src/heap/safepoint.cc index 7c901a6e6e..c705f64e5c 100644 --- a/src/heap/safepoint.cc +++ b/src/heap/safepoint.cc @@ -115,7 +115,7 @@ void IsolateSafepoint::InitiateGlobalSafepointScopeRaw( // wake it up. V8::GetCurrentPlatform() ->GetForegroundTaskRunner(reinterpret_cast(isolate())) - ->PostTask(std::make_unique(heap_)); + ->PostSignalTask(std::make_unique(heap_)); // Request an interrupt in case of long-running code. isolate()->stack_guard()->RequestGlobalSafepoint();