Bug 767234 - Don't invoke write barrier on generator slots (r=luke)

This commit is contained in:
Bill McCloskey
2012-06-22 11:24:20 -07:00
parent 0c8a90a8e4
commit 0adf2c88b8
5 changed files with 61 additions and 26 deletions

View File

@@ -1357,8 +1357,8 @@ GeneratorWriteBarrierPre(JSContext *cx, JSGenerator *gen)
* stack or closed. Barriers when copying onto the stack or closing preserve
* gc invariants.
*/
static bool
GeneratorHasMarkableFrame(JSGenerator *gen)
bool
js::GeneratorHasMarkableFrame(JSGenerator *gen)
{
return gen->state == JSGEN_NEWBORN || gen->state == JSGEN_OPEN;
}
@@ -1467,8 +1467,8 @@ js_NewGenerator(JSContext *cx)
/* Copy from the stack to the generator's floating frame. */
gen->regs.rebaseFromTo(stackRegs, *genfp);
genfp->copyFrameAndValues<HeapValue, Value, StackFrame::DoPostBarrier>(
cx, genvp, stackfp, stackvp, stackRegs.sp);
genfp->copyFrameAndValues<StackFrame::DoPostBarrier>(cx, (Value *)genvp, stackfp,
stackvp, stackRegs.sp);
obj->setPrivate(gen);
return obj;