[heap] GcAndSweep needs safepoint for EnsureSweepingCompleted()

Bug: v8:10315
Change-Id: Id7d5600e07cd0dfbce409925acf6047e019f501c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2352769
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69370}
This commit is contained in:
Dominik Inführ 2020-08-12 17:47:52 +02:00 committed by Commit Bot
parent df32131b3e
commit 3a16caa5c3

View File

@ -206,6 +206,7 @@ void AbandonCurrentlyFreeMemory(PagedSpace* space) {
void GcAndSweep(Heap* heap, AllocationSpace space) {
heap->CollectGarbage(space, GarbageCollectionReason::kTesting);
if (heap->mark_compact_collector()->sweeping_in_progress()) {
SafepointScope scope(heap);
heap->mark_compact_collector()->EnsureSweepingCompleted();
}
}