Bug 1880171 - Fix assertion about GC finalization that doesn't hold. r=sfink

The issue here is that we can delete zones if we hit OOM during zone creation
at which point the GC might also be doing foreground finalization, so the
assertion doesn't hold. This is fine because we won't be finalizing arenas in
this zone at this point.

Instead we can move it to where we are sweeping zones at the end of GC, where
it does hold.

Differential Revision: https://phabricator.services.mozilla.com/D201984
This commit is contained in:
Jon Coppeard 2024-02-15 16:21:25 +00:00
parent 9dc5b89f7d
commit 1aaacaeb4f
2 changed files with 1 additions and 2 deletions

View File

@ -2207,6 +2207,7 @@ void Compartment::sweepRealms(JS::GCContext* gcx, bool keepAtleastOne,
void GCRuntime::sweepZones(JS::GCContext* gcx, bool destroyingRuntime) {
MOZ_ASSERT_IF(destroyingRuntime, numActiveZoneIters == 0);
MOZ_ASSERT(foregroundFinalizedArenas.ref().isNothing());
if (numActiveZoneIters) {
return;

View File

@ -235,8 +235,6 @@ void ReleaseArenaList(JSRuntime* rt, ArenaList& arenaList,
}
ArenaLists::~ArenaLists() {
MOZ_ASSERT(runtime()->gc.foregroundFinalizedArenas.ref().isNothing());
AutoLockGC lock(runtime());
for (auto i : AllAllocKinds()) {