From 806edfa6eaef99c3071c09e362c386ef241f7fd3 Mon Sep 17 00:00:00 2001 From: Omer Katz Date: Tue, 31 Jan 2023 23:36:38 +0100 Subject: [PATCH] [heap] Release invalidates slots set in MinorMC. Bug: v8:12612, chromium:1411746 Change-Id: I6c06e6c924f9f548cb2014172d467ed19a5abbc5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4208940 Reviewed-by: Michael Lippautz Commit-Queue: Omer Katz Cr-Commit-Position: refs/heads/main@{#85605} --- src/heap/mark-compact.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index ba043ceae9..b01cb0c238 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -4173,10 +4173,6 @@ void VerifyRememberedSetsAfterEvacuation(Heap* heap, // GCs need to filter invalidated slots. DCHECK_NULL(chunk->invalidated_slots()); - // TODO(v8:12612): This DCHECK holds for MinorMC because MinorMC doesn't use - // incremental/concurrent marking, and thus it is not possible to allocate - // an invalidated slots set during MinorMC. This will likely break once - // MinorMC marks concurrently. DCHECK_NULL(chunk->invalidated_slots()); if (collector == GarbageCollector::MARK_COMPACTOR) { DCHECK_NULL(chunk->invalidated_slots()); @@ -6149,6 +6145,9 @@ void PageMarkingItem::MarkUntypedPointers(YoungGenerationMarkingTask* task) { return CheckAndMarkObject(task, slot); }, SlotSet::FREE_EMPTY_BUCKETS); + // The invalidated slots are not needed after old-to-new slots were + // processed. + chunk_->ReleaseInvalidatedSlots(); } void PageMarkingItem::MarkTypedPointers(YoungGenerationMarkingTask* task) {