Bug 1322536 - Make some mScanInProgress checks fatal in release builds. r=smaug
authorAndrew McCreight <continuation@gmail.com>
Thu, 08 Dec 2016 11:03:42 -1000
changeset 448187 3be54c62e0011dca5367be2a04e54bc6882f1908
parent 448186 833fef6e27005ca00af9a423f7eb9be588b7c631
child 448188 fd3076e08f1147d1e71b8052bc5d9b6ef07df267
push id38290
push userjbruaroey@mozilla.com
push dateFri, 09 Dec 2016 15:08:21 +0000
reviewerssmaug
bugs1322536
milestone53.0a1
Bug 1322536 - Make some mScanInProgress checks fatal in release builds. r=smaug MozReview-Commit-ID: 2hNtePfSxkF
xpcom/base/nsCycleCollector.cpp
--- 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;
 }