Bug 673068 - Tweak HitStackQuota call to placate stack sanity assertions (r=dvander)

--HG--
extra : rebase_source : 7701b293fd87534ffbafb7a5eebca6515d17e334
This commit is contained in:
Luke Wagner 2011-07-25 14:00:08 -07:00
parent 4917275e1c
commit c0b3b2d367
2 changed files with 20 additions and 2 deletions

View File

@ -0,0 +1,12 @@
// |jit-test| mjitalways
function f(x) {
var x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
var y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10;
var z0, z1, z2, z3, z4, z5, z6, z7, z8, z9, z10;
if (x == 0)
return;
f(x - 1);
}
f(1000);

View File

@ -332,10 +332,16 @@ mjit::Compiler::generatePrologue()
Jump stackCheck = masm.branchPtr(Assembler::AboveOrEqual, Registers::ReturnReg,
FrameAddress(offsetof(VMFrame, stackLimit)));
/* If the stack check fails... */
/*
* If the stack check fails then we need to either commit more of the
* reserved stack space or throw an error. Specify that the number of
* local slots is 0 (instead of the default script->nfixed) since the
* range [fp->slots(), fp->base()) may not be commited. (The calling
* contract requires only that the caller has reserved space for fp.)
*/
{
stubcc.linkExitDirect(stackCheck, stubcc.masm.label());
OOL_STUBCALL(stubs::HitStackQuota);
OOL_STUBCALL_LOCAL_SLOTS(stubs::HitStackQuota, 0);
stubcc.crossJump(stubcc.masm.jump(), masm.label());
}