Backed out changeset c1b7927df546.

This commit is contained in:
David Anderson 2012-08-22 22:19:06 -07:00
parent b8396b4791
commit d8024ac298
6 changed files with 14 additions and 15 deletions

View File

@ -491,7 +491,7 @@ JSCompartment::markTypes(JSTracer *trc)
}
void
JSCompartment::discardJitCode(FreeOp *fop, bool discardConstraints)
JSCompartment::discardJitCode(FreeOp *fop)
{
#ifdef JS_METHODJIT
@ -527,7 +527,7 @@ JSCompartment::discardJitCode(FreeOp *fop, bool discardConstraints)
script->resetUseCount();
}
types.sweepCompilerOutputs(fop, discardConstraints);
types.sweepCompilerOutputs(fop);
}
#endif /* JS_METHODJIT */
@ -547,7 +547,7 @@ JSCompartment::sweep(FreeOp *fop, bool releaseTypes)
{
{
gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_SWEEP_DISCARD_CODE);
discardJitCode(fop, !activeAnalysis && !gcPreserveCode);
discardJitCode(fop);
}
/* This function includes itself in PHASE_SWEEP_TABLES. */
@ -581,7 +581,6 @@ JSCompartment::sweep(FreeOp *fop, bool releaseTypes)
}
if (!activeAnalysis && !gcPreserveCode) {
JS_ASSERT(!types.constrainedOutputs);
gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_DISCARD_ANALYSIS);
/*

View File

@ -347,7 +347,7 @@ struct JSCompartment
void mark(JSTracer *trc);
void markTypes(JSTracer *trc);
void discardJitCode(js::FreeOp *fop, bool discardConstraints);
void discardJitCode(js::FreeOp *fop);
bool isDiscardingJitCode(JSTracer *trc);
void sweep(js::FreeOp *fop, bool releaseTypes);
void sweepCrossCompartmentWrappers();

View File

@ -3351,7 +3351,7 @@ BeginMarkPhase(JSRuntime *rt)
if (rt->gcIsIncremental) {
for (GCCompartmentsIter c(rt); !c.done(); c.next()) {
gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_MARK_DISCARD_CODE);
c->discardJitCode(rt->defaultFreeOp(), false);
c->discardJitCode(rt->defaultFreeOp());
}
}

View File

@ -5849,16 +5849,16 @@ TypeCompartment::sweep(FreeOp *fop)
pendingArray = NULL;
pendingCapacity = 0;
sweepCompilerOutputs(fop, true);
sweepCompilerOutputs(fop);
}
void
TypeCompartment::sweepCompilerOutputs(FreeOp *fop, bool discardConstraints)
TypeCompartment::sweepCompilerOutputs(FreeOp *fop)
{
if (constrainedOutputs) {
bool isCompiling = compiledInfo.outputIndex != RecompileInfo::NoCompilerRunning;
if (discardConstraints) {
JS_ASSERT(!isCompiling);
if (isCompiling && !compartment()->activeAnalysis)
{
#if DEBUG
for (unsigned i = 0; i < constrainedOutputs->length(); i++) {
CompilerOutput &co = (*constrainedOutputs)[i];
@ -5869,9 +5869,10 @@ TypeCompartment::sweepCompilerOutputs(FreeOp *fop, bool discardConstraints)
fop->delete_(constrainedOutputs);
constrainedOutputs = NULL;
} else {
// Constraints have captured an index to the constrained outputs
// vector. Thus, we invalidate all compilations except the one
// which is potentially running now.
// A Compilation is running and the AutoEnterCompilation class has
// captured an index into the constrained outputs vector and
// potentially created multiple types with this index. Instead, we
// invalidate all compilations except the one running now.
size_t len = constrainedOutputs->length();
for (unsigned i = 0; i < len; i++) {
if (i != compiledInfo.outputIndex) {

View File

@ -1180,7 +1180,7 @@ struct TypeCompartment
void markSetsUnknown(JSContext *cx, TypeObject *obj);
void sweep(FreeOp *fop);
void sweepCompilerOutputs(FreeOp *fop, bool discardConstraints);
void sweepCompilerOutputs(FreeOp *fop);
void finalizeObjects();
};

View File

@ -336,7 +336,6 @@ struct AutoEnterCompilation
info(cx->compartment->types.compiledInfo),
mode(mode)
{
JS_ASSERT(cx->compartment->activeAnalysis);
JS_ASSERT(info.outputIndex == RecompileInfo::NoCompilerRunning);
}