Commit cfca972e authored by Leon Bettscheider's avatar Leon Bettscheider Committed by V8 LUCI CQ

[heap] Cancel concurrent workers in minor final pause

This CL cancels concurrent workers instead of joining them in
MarkLiveObjects. Joining could trigger another costly run.

Bug: v8:13012
Change-Id: I873db6e9d612e219060de0fa2447f6c7c0e9de3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3885876Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
Commit-Queue: Leon Bettscheider <bettscheider@google.com>
Cr-Commit-Position: refs/heads/main@{#83105}
parent 725e5bcf
......@@ -954,6 +954,11 @@ bool ConcurrentMarking::Pause() {
return true;
}
void ConcurrentMarking::Cancel() {
Pause();
garbage_collector_.reset();
}
bool ConcurrentMarking::IsStopped() {
if (!v8_flags.concurrent_marking && !v8_flags.parallel_marking) return true;
......
......@@ -67,6 +67,7 @@ class V8_EXPORT_PRIVATE ConcurrentMarking {
// Preempts ongoing job ASAP. Returns true if concurrent marking was in
// progress, false otherwise.
bool Pause();
void Cancel();
// Schedules asynchronous job to perform concurrent marking at |priority| if
// not already running, otherwise adjusts the number of workers running job
......
......@@ -5809,7 +5809,7 @@ void MinorMarkCompactCollector::FinishConcurrentMarking() {
if (v8_flags.concurrent_marking) {
DCHECK_EQ(heap()->concurrent_marking()->garbage_collector(),
GarbageCollector::MINOR_MARK_COMPACTOR);
heap()->concurrent_marking()->Join();
heap()->concurrent_marking()->Cancel();
heap()->concurrent_marking()->FlushMemoryChunkData(
non_atomic_marking_state());
}
......
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