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) {