[baseline] Check dequeue compilation job success

Between the loop entry and the Dequeue call, another
thread might exhaust the queue itens and the Dequeue
call will return false without setting the job.

Bug: chromium:1272009
Change-Id: Ia254d97de36395676f069c100f46747b41483783
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3300130
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78084}
This commit is contained in:
Victor Gomes 2021-11-24 11:26:48 +01:00 committed by V8 LUCI CQ
parent 823c44d397
commit 6993e5ab82

View File

@ -166,7 +166,8 @@ class ConcurrentBaselineCompiler {
// we only switch back the memory chunks to RX at the end.
CodePageCollectionMemoryModificationScope batch_alloc(isolate_->heap());
std::unique_ptr<BaselineBatchCompilerJob> job;
incoming_queue_->Dequeue(&job);
if (!incoming_queue_->Dequeue(&job)) break;
DCHECK_NOT_NULL(job);
job->Compile();
outgoing_queue_->Enqueue(std::move(job));
}