From e4a9f0a5f2eeacad593aee7531f7280c05026ee6 Mon Sep 17 00:00:00 2001 From: Michael Lippautz Date: Wed, 1 Feb 2023 15:03:01 +0100 Subject: [PATCH] [heap] Remove PostponeInterruptScope from mark compact GCs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GC doesn't handle interrupts at this level and all callbacks that would execute user code are invoked before entering the marker. Bug: v8:12612 Change-Id: I13c7dab1f69c51d1dbe66721b3422d8ebf48c1c0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4212398 Auto-Submit: Michael Lippautz Reviewed-by: Dominik Inführ Commit-Queue: Michael Lippautz Cr-Commit-Position: refs/heads/main@{#85595} --- src/heap/mark-compact.cc | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index 2f18d67d42..ba043ceae9 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -2797,10 +2797,6 @@ void MarkCompactCollector::RetainMaps() { void MarkCompactCollector::MarkLiveObjects() { TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK); - // The recursive GC marker detects when it is nearing stack overflow, - // and switches to a different marking system. JS interrupts interfere - // with the C stack limit check. - PostponeInterruptsScope postpone(isolate()); const bool was_marked_incrementally = !heap_->incremental_marking()->IsStopped(); @@ -5448,16 +5444,16 @@ void MarkCompactCollector::UpdatePointersInClientHeap(Isolate* client) { if (chunk->InYoungGeneration()) chunk->ReleaseSlotSet(); - RememberedSet::IterateTyped(chunk, [this](SlotType slot_type, - Address slot) { - // Using UpdateStrongSlot is OK here, because there are no weak - // typed slots. - PtrComprCageBase cage_base = heap_->isolate(); - return UpdateTypedSlotHelper::UpdateTypedSlot( - heap_, slot_type, slot, [cage_base](FullMaybeObjectSlot slot) { - return UpdateStrongOldToSharedSlot(cage_base, slot); - }); - }); + RememberedSet::IterateTyped( + chunk, [this](SlotType slot_type, Address slot) { + // Using UpdateStrongSlot is OK here, because there are no weak + // typed slots. + PtrComprCageBase cage_base = heap_->isolate(); + return UpdateTypedSlotHelper::UpdateTypedSlot( + heap_, slot_type, slot, [cage_base](FullMaybeObjectSlot slot) { + return UpdateStrongOldToSharedSlot(cage_base, slot); + }); + }); if (chunk->InYoungGeneration()) chunk->ReleaseTypedSlotSet(); } } @@ -6341,8 +6337,6 @@ void MinorMarkCompactCollector::MarkLiveObjects() { DCHECK_NOT_NULL(local_marking_worklists_); DCHECK_NOT_NULL(main_marking_visitor_); - PostponeInterruptsScope postpone(isolate()); - const bool was_marked_incrementally = !heap_->incremental_marking()->IsStopped(); if (was_marked_incrementally) {