Bug 866681, part 1 - Track if any slice of CC was manually triggered. r=smaug

This commit is contained in:
Andrew McCreight 2015-05-13 12:48:52 -07:00
parent c69f123401
commit 97e1b7b5a7
2 changed files with 7 additions and 0 deletions

View File

@ -102,6 +102,7 @@ struct CycleCollectorResults
{
mForcedGC = false;
mMergedZones = false;
mAnyManual = false;
mVisitedRefCounted = 0;
mVisitedGCed = 0;
mFreedRefCounted = 0;
@ -114,6 +115,7 @@ struct CycleCollectorResults
bool mForcedGC;
bool mMergedZones;
bool mAnyManual; // true if any slice of the CC was manually triggered, or at shutdown.
uint32_t mVisitedRefCounted;
uint32_t mVisitedGCed;
uint32_t mFreedRefCounted;

View File

@ -3594,6 +3594,10 @@ nsCycleCollector::Collect(ccType aCCType,
timeLog.Checkpoint("Collect::FreeSnowWhite");
}
if (aCCType != SliceCC) {
mResults.mAnyManual = true;
}
++mResults.mNumSlices;
bool continueSlice = aBudget.isUnlimited() || !aPreferShorterSlices;
@ -3779,6 +3783,7 @@ nsCycleCollector::BeginCollection(ccType aCCType,
// Set up the data structures for building the graph.
mGraph.Init();
mResults.Init();
mResults.mAnyManual = (aCCType != SliceCC);
bool mergeZones = ShouldMergeZones(aCCType);
mResults.mMergedZones = mergeZones;