Bug 956081 - Fix the CC's GC-has-been-run detection in the presence of GGC; r=mccr8
authorTerrence Cole <terrence@mozilla.com>
Thu, 20 Feb 2014 13:38:32 -0800
changeset 169967 1f1bb2f2f868dae9381d6e998efc8b49d33cf982
parent 169966 21bbea0bdc12ebeaf9e2751c816de8418b13f41c
child 169968 8f879284bd82d73cdb4222ea1d84b9ed1535ffc6
push id40114
push usertcole@mozilla.com
push dateFri, 21 Feb 2014 23:00:50 +0000
treeherdermozilla-inbound@8f879284bd82 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs956081
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 956081 - Fix the CC's GC-has-been-run detection in the presence of GGC; r=mccr8
xpcom/base/CycleCollectedJSRuntime.cpp
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -872,25 +872,17 @@ nsCycleCollectionParticipant*
 CycleCollectedJSRuntime::ZoneParticipant()
 {
     return &mJSZoneCycleCollectorGlobal;
 }
 
 nsresult
 CycleCollectedJSRuntime::TraverseRoots(nsCycleCollectionNoteRootCallback &aCb)
 {
-  static bool gcHasRun = false;
-  if (!gcHasRun) {
-    uint32_t gcNumber = JS_GetGCParameter(mJSRuntime, JSGC_NUMBER);
-    if (!gcNumber) {
-      // Cannot cycle collect if GC has not run first!
-      MOZ_CRASH();
-    }
-    gcHasRun = true;
-  }
+  MOZ_ASSERT(!NeedCollect(), "Cannot cycle collect if GC has not run first!");
 
   TraverseNativeRoots(aCb);
 
   NoteWeakMapsTracer trc(mJSRuntime, TraceWeakMapping, aCb);
   js::TraceWeakMaps(&trc);
 
   return NS_OK;
 }