Bug 956081 - Fix the CC's GC-has-been-run detection in the presence of GGC; r=mccr8

This commit is contained in:
Terrence Cole
2014-02-20 13:38:32 -08:00
parent 035eb221ec
commit b1f6defc8a

View File

@@ -877,15 +877,7 @@ CycleCollectedJSRuntime::ZoneParticipant()
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);