Commit 65a6dae9 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Re-request stack guard for code logging

The current logic sometimes skips the request for a code logging stack
guard request, even though no such request is pending. This happens if
the previous stack guard already executed, but a foreground task is
still pending.
This CL fixes this by re-requesting a stack guard interrupt when the
first code is added to the vector of outstanding code to be logged.

Plus minor drive-by fix.

R=mstarzinger@chromium.org

Bug: v8:9163
Change-Id: I4937f3983f15e7122141b04ddb1432cd1f78828b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1578461
Auto-Submit: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60970}
parent 0c9c8a9c
......@@ -264,8 +264,8 @@ class CompilationUnitQueues {
{
Queue* steal_queue = &queues_[steal_from_task_id];
base::MutexGuard guard(&steal_queue->mutex_);
if (steal_queue->units_[wanted_tier].empty()) return {};
auto* steal_from_vector = &steal_queue->units_[wanted_tier];
if (steal_from_vector->empty()) return {};
size_t remaining = steal_from_vector->size() / 2;
stolen.assign(
std::make_move_iterator(steal_from_vector->begin()) + remaining,
......
......@@ -548,6 +548,8 @@ void WasmEngine::LogCode(WasmCode* code) {
&mutex_, &info->log_codes_task, isolate, this);
info->log_codes_task = new_task.get();
info->foreground_task_runner->PostTask(std::move(new_task));
}
if (info->code_to_log.empty()) {
isolate->stack_guard()->RequestLogWasmCode();
}
info->code_to_log.push_back(code);
......
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