Bug 1322536 - Make some mScanInProgress checks fatal in release builds. r=smaug
MozReview-Commit-ID: 2hNtePfSxkF
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2866,17 +2866,17 @@ nsCycleCollector::ForgetSkippable(bool a
}
MOZ_NEVER_INLINE void
nsCycleCollector::MarkRoots(SliceBudget& aBudget)
{
JS::AutoAssertNoGC nogc;
TimeLog timeLog;
AutoRestore<bool> ar(mScanInProgress);
- MOZ_ASSERT(!mScanInProgress);
+ MOZ_RELEASE_ASSERT(!mScanInProgress);
mScanInProgress = true;
MOZ_ASSERT(mIncrementalPhase == GraphBuildingPhase);
JS::AutoEnterCycleCollection autocc(Context()->Context());
bool doneBuilding = mBuilder->BuildGraph(aBudget);
if (!doneBuilding) {
timeLog.Checkpoint("MarkRoots()");
@@ -3187,17 +3187,17 @@ nsCycleCollector::ScanBlackNodes()
}
}
void
nsCycleCollector::ScanRoots(bool aFullySynchGraphBuild)
{
JS::AutoAssertNoGC nogc;
AutoRestore<bool> ar(mScanInProgress);
- MOZ_ASSERT(!mScanInProgress);
+ MOZ_RELEASE_ASSERT(!mScanInProgress);
mScanInProgress = true;
mWhiteNodeCount = 0;
MOZ_ASSERT(mIncrementalPhase == ScanAndCollectWhitePhase);
JS::AutoEnterCycleCollection autocc(Context()->Context());
if (!aFullySynchGraphBuild) {
ScanIncrementalRoots();
@@ -3850,17 +3850,17 @@ nsCycleCollector::BeginCollection(ccType
timeLog.Checkpoint("BeginCollection prepare graph builder");
if (mJSContext) {
mJSContext->TraverseRoots(*mBuilder);
timeLog.Checkpoint("mJSContext->TraverseRoots()");
}
AutoRestore<bool> ar(mScanInProgress);
- MOZ_ASSERT(!mScanInProgress);
+ MOZ_RELEASE_ASSERT(!mScanInProgress);
mScanInProgress = true;
mPurpleBuf.SelectPointers(*mBuilder);
timeLog.Checkpoint("SelectPointers()");
mBuilder->DoneAddingRoots();
mIncrementalPhase = GraphBuildingPhase;
}