diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index 5c97349be042..6ab7eb5fd71e 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -7282,9 +7282,11 @@ void GCRuntime::incrementalSlice(SliceBudget& budget, JS::GCReason reason, MOZ_FALLTHROUGH; case State::Compact: + MOZ_ASSERT(nursery().isEmpty()); + storeBuffer().checkEmpty(); + if (isCompacting) { MOZ_ASSERT(nursery().isEmpty()); - storeBuffer().checkEmpty(); if (!startedCompacting) { beginCompactPhase(); } @@ -7628,13 +7630,13 @@ bool GCRuntime::shouldCollectNurseryForSlice(bool nonincrementalByAPI, switch (incrementalState) { case State::NotActive: case State::Sweep: + case State::Finalize: case State::Compact: + case State::Decommit: return true; case State::Mark: return (nonincrementalByAPI || budget.isUnlimited() || lastMarkSlice || nursery().shouldCollect() || hasIncrementalTwoSliceZealMode()); - case State::Finalize: - case State::Decommit: case State::Finish: return false; case State::MarkRoots: