diff options
Diffstat (limited to 'js/src/gc/Sweeping.cpp')
-rw-r--r-- | js/src/gc/Sweeping.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/js/src/gc/Sweeping.cpp b/js/src/gc/Sweeping.cpp index 123b2c9650..2cd6a2c662 100644 --- a/js/src/gc/Sweeping.cpp +++ b/js/src/gc/Sweeping.cpp @@ -441,6 +441,12 @@ void GCRuntime::waitBackgroundSweepEnd() { void GCRuntime::startBackgroundFree() { AutoLockHelperThreadState lock; + + if (lifoBlocksToFree.ref().isEmpty() && + buffersToFreeAfterMinorGC.ref().empty()) { + return; + } + freeTask.startOrRunIfIdle(lock); } @@ -1194,18 +1200,19 @@ class ImmediateSweepWeakCacheTask : public GCParallelTask { }; void GCRuntime::updateAtomsBitmap() { - DenseBitmap marked; - if (atomMarking.computeBitmapFromChunkMarkBits(rt, marked)) { - for (GCZonesIter zone(this); !zone.done(); zone.next()) { - atomMarking.refineZoneBitmapForCollectedZone(zone, marked); + size_t collectedZones = 0; + size_t uncollectedZones = 0; + for (ZonesIter zone(this, SkipAtoms); !zone.done(); zone.next()) { + if (zone->isCollecting()) { + collectedZones++; + } else { + uncollectedZones++; } - } else { - // Ignore OOM in computeBitmapFromChunkMarkBits. The - // refineZoneBitmapForCollectedZone call can only remove atoms from the - // zone bitmap, so it is conservative to just not call it. } - atomMarking.markAtomsUsedByUncollectedZones(rt); + atomMarking.refineZoneBitmapsForCollectedZones(this, collectedZones); + + atomMarking.markAtomsUsedByUncollectedZones(this, uncollectedZones); // For convenience sweep these tables non-incrementally as part of bitmap // sweeping; they are likely to be much smaller than the main atoms table. |