Bug 740654 - Hoist recursion checks out of Interpret into callers so that Interpret does not throw when trying to rejoin from mjit (r=bhackett)

--HG--
extra : rebase_source : f85c12860d9172e5167e5952352b02d367e53057
This commit is contained in:
Luke Wagner 2012-04-02 08:57:27 -07:00
parent f260ec62ee
commit f1fbba550a
2 changed files with 9 additions and 4 deletions

View File

@ -428,10 +428,13 @@ js::RunScript(JSContext *cx, JSScript *script, StackFrame *fp)
JS_ASSERT(script);
JS_ASSERT(fp == cx->fp());
JS_ASSERT(fp->script() == script);
JS_ASSERT_IF(!fp->isGeneratorFrame(), cx->regs().pc == script->code);
#ifdef JS_METHODJIT_SPEW
JMCheckLogging();
#endif
JS_CHECK_RECURSION(cx, return false);
/* FIXME: Once bug 470510 is fixed, make this an assert. */
if (script->compileAndGo) {
if (fp->scopeChain().global().isCleared()) {
@ -1567,9 +1570,6 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode)
int32_t len;
len = 0;
/* Check for too deep of a native thread stack. */
JS_CHECK_RECURSION(cx, goto error);
DO_NEXT_OP(len);
#if JS_THREADED_INTERP
@ -4028,6 +4028,9 @@ END_CASE(JSOP_ARRAYPUSH)
JS_ASSERT(&cx->regs() == &regs);
JS_ASSERT(uint32_t(regs.pc - script->code) < script->length);
/* When rejoining, we must not err before finishing Interpret's prologue. */
JS_ASSERT(interpMode != JSINTERP_REJOIN);
if (cx->isExceptionPending()) {
/* Restore atoms local in case we will resume. */
atoms = script->atoms;

View File

@ -367,7 +367,9 @@ UncachedInlineCall(VMFrame &f, InitialFrameFlags initial,
regs.fp()->resetInlinePrev(f.fp(), f.regs.pc);
}
bool ok = !!Interpret(cx, cx->fp());
JS_CHECK_RECURSION(cx, return false);
bool ok = Interpret(cx, cx->fp());
f.cx->stack.popInlineFrame(regs);
if (ok)