Commit 2600038d authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[v8 platform] Introduce CallBlockingTaskFromBackgroundThread()

and use it for parallel GC as it blocks the main thread.

On Chromium this will result in a TaskPriority::USER_BLOCKING task,
allowing TaskScheduler to prioritize them above all other async work.

R=ahaas@chromium.org

Bug: chromium:817421
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I8c782eb045035ce2899214528deae5a45f0e6600
Reviewed-on: https://chromium-review.googlesource.com/941946
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51650}
parent e89daf3b
......@@ -346,6 +346,15 @@ class Platform {
CallOnBackgroundThread(task, kShortRunningTask);
}
/**
* Schedules a task that blocks the main thread to be invoked with
* high-priority on a worker thread.
*/
virtual void CallBlockingTaskOnWorkerThread(Task* task) {
// TODO(gab): Make pure-virtual when all embedders override this.
CallOnWorkerThread(task);
}
/**
* Schedules a task to be invoked on a foreground thread wrt a specific
* |isolate|. Tasks posted for the same isolate should be execute in order of
......
......@@ -105,7 +105,7 @@ void ItemParallelJob::Run(std::shared_ptr<Counters> async_counters) {
: base::Optional<AsyncTimedHistogram>());
task_ids[i] = task->id();
if (i > 0) {
V8::GetCurrentPlatform()->CallOnWorkerThread(task);
V8::GetCurrentPlatform()->CallBlockingTaskOnWorkerThread(task);
} else {
main_task = task;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment