Commit 2a70ebfb authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Resolve data race in heap.cc DCHECK

This check verified that either concurrent marking was enabled, or
the worklist for keeping v8 references found by concurrent markers
is empty.
Checking that the worklist is empty when concurrent markers are
active results in a data race. Switching the order of the conditions
in the DCHECK means will only check the worklist if we don't have any
concurrent markers.

Bug: 986235
Change-Id: I0c4b15c944c3d52dc72fb150b47b97b03d475f17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1892772
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711487}
parent 3f4af0c5
......@@ -548,9 +548,9 @@ void ThreadHeap::FlushV8References() {
if (!thread_state_->IsUnifiedGCMarkingInProgress())
return;
DCHECK(v8_references_worklist_->IsGlobalEmpty() ||
base::FeatureList::IsEnabled(
blink::features::kBlinkHeapConcurrentMarking));
DCHECK(base::FeatureList::IsEnabled(
blink::features::kBlinkHeapConcurrentMarking) ||
v8_references_worklist_->IsGlobalEmpty());
V8ReferencesWorklist::View v8_references(v8_references_worklist_.get(),
WorklistTaskId::MutatorThread);
......
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