mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1135141 - Make LAST_DITCH GC more robust; r=jonco
This commit is contained in:
parent
ff59bf2cae
commit
0cf27b9008
@ -921,7 +921,7 @@ class GCRuntime
|
||||
void protectRelocatedArenas(ArenaHeader *relocatedList);
|
||||
void unprotectRelocatedArenas(ArenaHeader *relocatedList);
|
||||
#endif
|
||||
void finishCollection();
|
||||
void finishCollection(JS::gcreason::Reason reason);
|
||||
|
||||
void computeNonIncrementalMarkingForValidation();
|
||||
void validateIncrementalMarking();
|
||||
|
@ -5546,7 +5546,7 @@ GCRuntime::compactPhase(bool lastGC, JS::gcreason::Reason reason)
|
||||
}
|
||||
|
||||
void
|
||||
GCRuntime::finishCollection()
|
||||
GCRuntime::finishCollection(JS::gcreason::Reason reason)
|
||||
{
|
||||
MOZ_ASSERT(marker.isDrained());
|
||||
marker.stop();
|
||||
@ -5566,6 +5566,13 @@ GCRuntime::finishCollection()
|
||||
}
|
||||
|
||||
lastGCTime = currentTime;
|
||||
|
||||
// If this is an OOM GC reason, wait on the background sweeping thread
|
||||
// before returning to ensure that we free as much as possible.
|
||||
if (reason == JS::gcreason::LAST_DITCH || reason == JS::gcreason::MEM_PRESSURE) {
|
||||
gcstats::AutoPhase ap(stats, gcstats::PHASE_WAIT_BACKGROUND_THREAD);
|
||||
rt->gc.waitBackgroundSweepOrAllocEnd();
|
||||
}
|
||||
}
|
||||
|
||||
/* Start a new heap session. */
|
||||
@ -5933,7 +5940,7 @@ GCRuntime::incrementalCollectSlice(SliceBudget &budget, JS::gcreason::Reason rea
|
||||
if (isCompacting && compactPhase(lastGC, reason) == NotFinished)
|
||||
break;
|
||||
|
||||
finishCollection();
|
||||
finishCollection(reason);
|
||||
|
||||
incrementalState = NO_INCREMENTAL;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user