зеркало из https://github.com/mozilla/gecko-dev.git
Bug 730753, call CC after full GC, r=mccr8
This commit is contained in:
Родитель
cc05c57f6b
Коммит
c3a5e54da8
|
@ -181,6 +181,7 @@ static PRUint32 sForgetSkippableBeforeCC = 0;
|
|||
static PRUint32 sPreviousSuspectedCount = 0;
|
||||
|
||||
static bool sCleanupSinceLastGC = true;
|
||||
static bool sNeedsFullCC = false;
|
||||
|
||||
nsScriptNameSpaceManager *gNameSpaceManager;
|
||||
|
||||
|
@ -3340,6 +3341,7 @@ nsJSContext::CycleCollectNow(nsICycleCollectorListener *aListener,
|
|||
sRemovedPurples = 0;
|
||||
sForgetSkippableBeforeCC = 0;
|
||||
sCleanupSinceLastGC = true;
|
||||
sNeedsFullCC = false;
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -3395,7 +3397,8 @@ CCTimerFired(nsITimer *aTimer, void *aClosure)
|
|||
} else {
|
||||
sPreviousSuspectedCount = 0;
|
||||
nsJSContext::KillCCTimer();
|
||||
if (nsCycleCollector_suspectedCount() > 500 ||
|
||||
if (sNeedsFullCC ||
|
||||
nsCycleCollector_suspectedCount() > 500 ||
|
||||
sLastCCEndTime + NS_CC_FORCED < PR_Now()) {
|
||||
nsJSContext::CycleCollectNow();
|
||||
}
|
||||
|
@ -3493,7 +3496,8 @@ nsJSContext::MaybePokeCC()
|
|||
return;
|
||||
}
|
||||
|
||||
if (nsCycleCollector_suspectedCount() > 100 ||
|
||||
if (sNeedsFullCC ||
|
||||
nsCycleCollector_suspectedCount() > 100 ||
|
||||
sLastCCEndTime + NS_CC_FORCED < PR_Now()) {
|
||||
sCCTimerFireCount = 0;
|
||||
CallCreateInstance("@mozilla.org/timer;1", &sCCTimer);
|
||||
|
@ -3608,6 +3612,7 @@ DOMGCSliceCallback(JSRuntime *aRt, js::GCProgress aProgress, const js::GCDescrip
|
|||
// If this was a full GC, poke the CC to run soon.
|
||||
if (!aDesc.isCompartment) {
|
||||
sGCHasRun = true;
|
||||
sNeedsFullCC = true;
|
||||
nsJSContext::MaybePokeCC();
|
||||
}
|
||||
}
|
||||
|
@ -3721,6 +3726,7 @@ nsJSRuntime::Startup()
|
|||
sLoadingInProgress = false;
|
||||
sCCollectedWaitingForGC = 0;
|
||||
sPostGCEventsToConsole = false;
|
||||
sNeedsFullCC = false;
|
||||
gNameSpaceManager = nsnull;
|
||||
sRuntimeService = nsnull;
|
||||
sRuntime = nsnull;
|
||||
|
|
Загрузка…
Ссылка в новой задаче