Bug 886630 - Post barrier generator frames when they stop running; r=billm

This commit is contained in:
Terrence Cole
2013-07-09 17:31:42 -07:00
parent 311f14b5ed
commit 70ac8d15ee
2 changed files with 121 additions and 0 deletions

View File

@@ -1356,6 +1356,14 @@ GeneratorWriteBarrierPre(JSContext *cx, JSGenerator *gen)
MarkGeneratorFrame(zone->barrierTracer(), gen);
}
static void
GeneratorWriteBarrierPost(JSContext *cx, JSGenerator *gen)
{
#ifdef JSGC_GENERATIONAL
cx->runtime()->gcStoreBuffer.putWholeCell(gen->obj);
#endif
}
/*
* Only mark generator frames/slots when the generator is not active on the
* stack or closed. Barriers when copying onto the stack or closing preserve
@@ -1588,6 +1596,7 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, HandleObject obj,
JS_ASSERT(op != JSGENOP_CLOSE);
gen->fp->clearYielding();
gen->state = JSGEN_OPEN;
GeneratorWriteBarrierPost(cx, gen);
return ok;
}