mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 979047, part 4 - Run ICCSliceTime() after PrepareForCollectionSlice. r=smaug
This way we take into account time spent finishing off a GC, or something.
This commit is contained in:
parent
4fa61d549b
commit
ccea4e7f95
@ -2124,7 +2124,7 @@ nsJSContext::CycleCollectNow(nsICycleCollectorListener *aListener,
|
||||
|
||||
//static
|
||||
void
|
||||
nsJSContext::RunCycleCollectorSlice(int64_t aSliceTime)
|
||||
nsJSContext::RunCycleCollectorSlice()
|
||||
{
|
||||
if (!NS_IsMainThread()) {
|
||||
return;
|
||||
@ -2135,7 +2135,7 @@ nsJSContext::RunCycleCollectorSlice(int64_t aSliceTime)
|
||||
// Ideally, the slice time would be decreased by the amount of
|
||||
// time spent on PrepareForCycleCollection().
|
||||
gCCStats.PrepareForCycleCollectionSlice();
|
||||
nsCycleCollector_collectSlice(aSliceTime);
|
||||
nsCycleCollector_collectSlice(ICCSliceTime());
|
||||
gCCStats.FinishCycleCollectionSlice();
|
||||
}
|
||||
|
||||
@ -2160,7 +2160,7 @@ ICCTimerFired(nsITimer* aTimer, void* aClosure)
|
||||
}
|
||||
}
|
||||
|
||||
nsJSContext::RunCycleCollectorSlice(ICCSliceTime());
|
||||
nsJSContext::RunCycleCollectorSlice();
|
||||
}
|
||||
|
||||
//static
|
||||
@ -2436,7 +2436,7 @@ CCTimerFired(nsITimer *aTimer, void *aClosure)
|
||||
// We are in the final timer fire and still meet the conditions for
|
||||
// triggering a CC. Let RunCycleCollectorSlice finish the current IGC, if
|
||||
// any because that will allow us to include the GC time in the CC pause.
|
||||
nsJSContext::RunCycleCollectorSlice(ICCSliceTime());
|
||||
nsJSContext::RunCycleCollectorSlice();
|
||||
}
|
||||
} else if ((sPreviousSuspectedCount + 100) <= suspected) {
|
||||
// Only do a forget skippable if there are more than a few new objects.
|
||||
|
@ -110,10 +110,8 @@ public:
|
||||
static void CycleCollectNow(nsICycleCollectorListener *aListener = nullptr,
|
||||
int32_t aExtraForgetSkippableCalls = 0);
|
||||
|
||||
// If aSliceTime is negative, the CC will run to completion. If aSliceTime
|
||||
// is 0, only a minimum quantum of work will be done. Otherwise, aSliceTime
|
||||
// will be used as the time budget for the slice, in ms.
|
||||
static void RunCycleCollectorSlice(int64_t aSliceTime);
|
||||
// Run a cycle collector slice, using a heuristic to decide how long to run it.
|
||||
static void RunCycleCollectorSlice();
|
||||
|
||||
static void BeginCycleCollectionCallback();
|
||||
static void EndCycleCollectionCallback(mozilla::CycleCollectorResults &aResults);
|
||||
|
Loading…
Reference in New Issue
Block a user