Commit b58ea26a authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Move call to ThreadHeap::FlushV8References

We called Heap().FlushV8References in IncrementalMarkingStep after
returning from MarkPhaseAdvanceMarking. This means that
FlushV8References is not called during the atomic pause (which
doesn't use IncrementalMarkingStep). This could lead to errors.
Moving the call to FlushV8References into MarkPhaseAdvanceMarking
means it will be called regardless of whether we're in incremental
marking or atomic pause.

Bug: 986235
Change-Id: I70f85908f0ed8d750456f19d83f779734a5fac21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1813328
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: default avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702786}
parent ad9f0404
......@@ -324,7 +324,7 @@ bool ThreadHeap::AdvanceMarking(MarkingVisitor* visitor,
},
WorklistTaskId::MutatorThread);
if (!finished)
return false;
break;
// Iteratively mark all objects that were previously discovered while
// being in construction. The objects can be processed incrementally once
......@@ -336,7 +336,7 @@ bool ThreadHeap::AdvanceMarking(MarkingVisitor* visitor,
},
WorklistTaskId::MutatorThread);
if (!finished)
return false;
break;
}
InvokeEphemeronCallbacks(visitor);
......@@ -344,7 +344,9 @@ bool ThreadHeap::AdvanceMarking(MarkingVisitor* visitor,
// Rerun loop if ephemeron processing queued more objects for tracing.
} while (!marking_worklist_->IsGlobalEmpty());
return true;
FlushV8References();
return finished;
}
bool ThreadHeap::AdvanceConcurrentMarking(ConcurrentMarkingVisitor* visitor,
......
......@@ -672,8 +672,6 @@ void ThreadState::AtomicPauseMarkPrologue(BlinkGC::StackState stack_state,
// Stop concurrent markers
marker_scheduler_->CancelAndWait();
active_markers_ = 0;
// Flush the last remaining references concurrent markers found.
Heap().FlushV8References();
}
DisableIncrementalMarkingBarrier();
current_gc_data_.reason = reason;
......@@ -1111,8 +1109,6 @@ void ThreadState::IncrementalMarkingStep(BlinkGC::StackState stack_state) {
bool complete = MarkPhaseAdvanceMarking(
base::TimeTicks::Now() + next_incremental_marking_step_duration_);
Heap().FlushV8References();
if (base::FeatureList::IsEnabled(
blink::features::kBlinkHeapConcurrentMarking)) {
complete = complete && ConcurrentMarkingStep();
......
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