Commit 72559ca8 authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Disable compaction after stopping concurrent markers

In case marking is in progress, first stop concurrent markers and
then cancel compaction.
If marking is not in progress, compaction should not have been
initialized yet, so it suffices to confirm that compaction is disabled.

Bug: 1058777
Change-Id: I8f9c6e2c461a6d933d56a7e39c18cbd09e6a40f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089873
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747364}
parent a50f7cea
......@@ -746,11 +746,6 @@ void ThreadState::AtomicPauseMarkPrologue(
stack_state = BlinkGC::kHeapPointersOnStack;
}
// Compaction needs to be canceled when incremental marking ends with a
// conservative GC.
if (stack_state == BlinkGC::kHeapPointersOnStack)
Heap().Compaction()->Cancel();
if (IsMarkingInProgress()) {
// Incremental marking is already in progress. Only update the state
// that is necessary to update.
......@@ -772,11 +767,16 @@ void ThreadState::AtomicPauseMarkPrologue(
DCHECK(write_barrier_worklist->IsLocalEmpty(concurrent_task));
}
#endif // DCHECK_IS_ON()
// Compaction needs to be canceled when incremental marking ends with a
// conservative GC.
if (stack_state == BlinkGC::kHeapPointersOnStack)
Heap().Compaction()->Cancel();
DisableIncrementalMarkingBarrier();
current_gc_data_.reason = reason;
current_gc_data_.stack_state = stack_state;
Heap().stats_collector()->UpdateReason(reason);
} else {
DCHECK(!Heap().Compaction()->IsCompacting());
MarkPhasePrologue(collection_type, stack_state, marking_type, reason);
}
......
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