[JAEGER] Fixed bugs in commit bumping (bug 586886 fallout).

This commit is contained in:
David Anderson 2010-08-13 15:27:33 -07:00
parent 28704289d9
commit 7e9b41be71
3 changed files with 3 additions and 3 deletions

View File

@ -143,7 +143,7 @@ StackSpace::ensureSpace(JSContext *maybecx, Value *start, Value *from,
* over-recursing.
*/
ptrdiff_t nvals = VALUES_PER_STACK_FRAME + nslots;
if (commitEnd < limit && from + nvals < limit) {
if (commitEnd <= limit && from + nvals < (start + MAX_STACK_USAGE)) {
if (!ensureSpace(maybecx, from, nvals))
return false;

View File

@ -733,7 +733,7 @@ mjit::ProfileStubCall(VMFrame &f)
bool
VMFrame::slowEnsureSpace(uint32 nslots)
{
return cx->stack().ensureSpace(cx, reinterpret_cast<Value*>(fp), regs.sp,
return cx->stack().ensureSpace(cx, reinterpret_cast<Value*>(entryFp), regs.sp,
stackLimit, nslots);
}

View File

@ -138,7 +138,7 @@ struct VMFrame
inline bool ensureSpace(uint32 nmissing, uint32 nslots) {
/* Fast check - if it's below the limit, it's safe to just get a frame. */
if (JS_LIKELY(regs.sp + nmissing + nslots < stackLimit))
if (JS_LIKELY(regs.sp + VALUES_PER_STACK_FRAME + nmissing + nslots < stackLimit))
return true;
/* Slower check that might have to commit memory or throw an error. */