Bug 904282 - Don't mark atoms during last GC (r=jonco)

This commit is contained in:
Bill McCloskey 2013-08-14 14:48:40 -07:00
parent 5f588a74e9
commit ddad590f83
2 changed files with 5 additions and 7 deletions

View File

@ -687,19 +687,17 @@ js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
MarkScriptRoot(trc, &vec[i].script, "scriptAndCountsVector"); MarkScriptRoot(trc, &vec[i].script, "scriptAndCountsVector");
} }
if (!trc->runtime->isHeapMinorCollecting() && if (rt->hasContexts() &&
!trc->runtime->isHeapMinorCollecting() &&
(!IS_GC_MARKING_TRACER(trc) || rt->atomsCompartment()->zone()->isCollecting())) (!IS_GC_MARKING_TRACER(trc) || rt->atomsCompartment()->zone()->isCollecting()))
{ {
MarkAtoms(trc); MarkAtoms(trc);
rt->staticStrings.trace(trc);
#ifdef JS_ION #ifdef JS_ION
/* Any Ion wrappers survive until the runtime is being torn down. */ ion::IonRuntime::Mark(trc);
if (rt->hasContexts())
ion::IonRuntime::Mark(trc);
#endif #endif
} }
rt->staticStrings.trace(trc);
for (ContextIter acx(rt); !acx.done(); acx.next()) for (ContextIter acx(rt); !acx.done(); acx.next())
acx->mark(trc); acx->mark(trc);

View File

@ -202,7 +202,7 @@ js::SweepAtoms(JSRuntime *rt)
bool isDying = IsStringAboutToBeFinalized(&atom); bool isDying = IsStringAboutToBeFinalized(&atom);
/* Pinned or interned key cannot be finalized. */ /* Pinned or interned key cannot be finalized. */
JS_ASSERT_IF(entry.isTagged(), !isDying); JS_ASSERT_IF(rt->hasContexts() && entry.isTagged(), !isDying);
if (isDying) if (isDying)
e.removeFront(); e.removeFront();