Bug 744489 - Fix incremental GC assertion in ValidateIncrementalMarking (r=igor)

This commit is contained in:
Bill McCloskey 2012-04-12 11:14:43 -07:00
parent 383ffc625c
commit e3c3dabac3
3 changed files with 11 additions and 8 deletions

View File

@ -734,6 +734,7 @@ JSRuntime::JSRuntime()
gcStats(thisFromCtor()),
gcNumber(0),
gcStartNumber(0),
gcIsFull(false),
gcTriggerReason(gcreason::NO_REASON),
gcStrictCompartmentChecking(false),
gcIncrementalState(gc::NO_INCREMENTAL),

View File

@ -362,6 +362,9 @@ struct JSRuntime : js::RuntimeFriendFields
/* The gcNumber at the time of the most recent GC's first slice. */
uint64_t gcStartNumber;
/* Whether all compartments are being collected in first GC slice. */
bool gcIsFull;
/* The reason that an interrupt-triggered GC should be called. */
js::gcreason::Reason gcTriggerReason;

View File

@ -2280,14 +2280,7 @@ MarkRuntime(JSTracer *trc, bool useSavedRoots = false)
* atoms. Otherwise, the non-collected compartments could contain pointers
* to atoms that we would miss.
*/
bool isFullGC = true;
if (IS_GC_MARKING_TRACER(trc)) {
for (CompartmentsIter c(rt); !c.done(); c.next()) {
if (!c->isCollecting())
isFullGC = false;
}
}
MarkAtomState(trc, rt->gcKeepAtoms || !isFullGC);
MarkAtomState(trc, rt->gcKeepAtoms || (IS_GC_MARKING_TRACER(trc) && !rt->gcIsFull));
rt->staticStrings.trace(trc);
for (ContextIter acx(rt); !acx.done(); acx.next())
@ -2903,6 +2896,12 @@ PurgeRuntime(JSTracer *trc)
static void
BeginMarkPhase(JSRuntime *rt)
{
rt->gcIsFull = true;
for (CompartmentsIter c(rt); !c.done(); c.next()) {
if (!c->isCollecting())
rt->gcIsFull = false;
}
rt->gcMarker.start(rt);
JS_ASSERT(!rt->gcMarker.callback);
JS_ASSERT(IS_GC_MARKING_TRACER(&rt->gcMarker));