Bug 547851 - remove JSStackFrame::regs, JSStackFrame::callerFrame.sp (r=dvander)

This commit is contained in:
Luke Wagner
2010-03-03 18:10:13 -08:00
parent 4e60a6c93d
commit f6842fecdf
22 changed files with 671 additions and 483 deletions

View File

@@ -74,6 +74,7 @@
#include "jsxml.h"
#endif
#include "jscntxtinlines.h"
#include "jsobjinlines.h"
#include "jsstrinlines.h"
@@ -794,14 +795,13 @@ js_NewGenerator(JSContext *cx)
/* Initialize JSGenerator. */
gen->obj = obj;
gen->state = JSGEN_NEWBORN;
gen->savedRegs.pc = fp->regs->pc;
JS_ASSERT(fp->regs->sp == fp->slots() + fp->script->nfixed);
gen->savedRegs.pc = cx->regs->pc;
JS_ASSERT(cx->regs->sp == fp->slots() + fp->script->nfixed);
gen->savedRegs.sp = slots + fp->script->nfixed;
gen->vplen = vplen;
gen->liveFrame = newfp;
/* Copy generator's stack frame copy in from |cx->fp|. */
newfp->regs = &gen->savedRegs;
newfp->imacpc = NULL;
newfp->callobj = fp->callobj;
if (fp->callobj) { /* Steal call object. */
@@ -922,7 +922,6 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, JSObject *obj,
memcpy(vp, genVp, usedBefore * sizeof(jsval));
fp->flags &= ~JSFRAME_FLOATING_GENERATOR;
fp->argv = vp + 2;
fp->regs = &gen->savedRegs;
gen->savedRegs.sp = fp->slots() + (gen->savedRegs.sp - genfp->slots());
JS_ASSERT(uintN(gen->savedRegs.sp - fp->slots()) <= fp->script->nslots);
@@ -945,7 +944,7 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, JSObject *obj,
(void)cx->enterGenerator(gen); /* OOM check above. */
/* Officially push |fp|. |frame|'s destructor pops. */
cx->stack().pushExecuteFrame(cx, frame, NULL);
cx->stack().pushExecuteFrame(cx, frame, gen->savedRegs, NULL);
ok = js_Interpret(cx);