Fix not bumping the commit with large scripts (bug 634629, r=luke).
authorDavid Anderson <danderson@mozilla.com>
Wed, 16 Feb 2011 16:56:40 -0800
changeset 62791 d0c8f25fe4f5bf52fe6c6325751430dde736ccd9
parent 62790 90be6dccf2c6d5c4fefedcc2963d7e9eefd15594
child 62792 641d4c7e217bddfbc030a9b6637d065f083e0ad3
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersluke
bugs634629
milestone2.0b12pre
Fix not bumping the commit with large scripts (bug 634629, r=luke).
js/src/jscntxt.cpp
js/src/jscntxt.h
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -296,21 +296,21 @@ StackSpace::popSegmentForInvoke(const In
 #ifdef DEBUG
     invokeSegment = ag.prevInvokeSegment;
     invokeFrame = ag.prevInvokeFrame;
 #endif
     invokeArgEnd = ag.prevInvokeArgEnd;
 }
 
 bool
-StackSpace::getSegmentAndFrame(JSContext *cx, uintN vplen, uintN nfixed,
+StackSpace::getSegmentAndFrame(JSContext *cx, uintN vplen, uintN nslots,
                                FrameGuard *fg) const
 {
     Value *start = firstUnused();
-    uintN nvals = VALUES_PER_STACK_SEGMENT + vplen + VALUES_PER_STACK_FRAME + nfixed;
+    uintN nvals = VALUES_PER_STACK_SEGMENT + vplen + VALUES_PER_STACK_FRAME + nslots;
     if (!ensureSpace(cx, start, nvals))
         return false;
 
     fg->seg_ = new(start) StackSegment;
     fg->vp_ = start + VALUES_PER_STACK_SEGMENT;
     fg->fp_ = reinterpret_cast<JSStackFrame *>(fg->vp() + vplen);
     return true;
 }
@@ -358,17 +358,17 @@ FrameGuard::~FrameGuard()
     JS_ASSERT(cx_->activeSegment() == segment());
     JS_ASSERT(cx_->maybefp() == fp());
     cx_->stack().popSegmentAndFrame(cx_);
 }
 
 bool
 StackSpace::getExecuteFrame(JSContext *cx, JSScript *script, ExecuteFrameGuard *fg) const
 {
-    return getSegmentAndFrame(cx, 2, script->nfixed, fg);
+    return getSegmentAndFrame(cx, 2, script->nslots, fg);
 }
 
 void
 StackSpace::pushExecuteFrame(JSContext *cx, JSObject *initialVarObj, ExecuteFrameGuard *fg)
 {
     JSStackFrame *fp = fg->fp();
     JSScript *script = fp->script();
     fg->regs_.pc = script->code;
@@ -376,30 +376,30 @@ StackSpace::pushExecuteFrame(JSContext *
     fg->regs_.sp = fp->base();
     pushSegmentAndFrame(cx, &fg->regs_, fg);
     fg->seg_->setInitialVarObj(initialVarObj);
 }
 
 bool
 StackSpace::pushDummyFrame(JSContext *cx, JSObject &scopeChain, DummyFrameGuard *fg)
 {
-    if (!getSegmentAndFrame(cx, 0 /*vplen*/, 0 /*nfixed*/, fg))
+    if (!getSegmentAndFrame(cx, 0 /*vplen*/, 0 /*nslots*/, fg))
         return false;
     fg->fp()->initDummyFrame(cx, scopeChain);
     fg->regs_.fp = fg->fp();
     fg->regs_.pc = NULL;
     fg->regs_.sp = fg->fp()->slots();
     pushSegmentAndFrame(cx, &fg->regs_, fg);
     return true;
 }
 
 bool
-StackSpace::getGeneratorFrame(JSContext *cx, uintN vplen, uintN nfixed, GeneratorFrameGuard *fg)
+StackSpace::getGeneratorFrame(JSContext *cx, uintN vplen, uintN nslots, GeneratorFrameGuard *fg)
 {
-    return getSegmentAndFrame(cx, vplen, nfixed, fg);
+    return getSegmentAndFrame(cx, vplen, nslots, fg);
 }
 
 void
 StackSpace::pushGeneratorFrame(JSContext *cx, JSFrameRegs *regs, GeneratorFrameGuard *fg)
 {
     JS_ASSERT(regs->fp == fg->fp());
     JS_ASSERT(regs->fp->prev() == cx->maybefp());
     pushSegmentAndFrame(cx, regs, fg);
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -594,17 +594,17 @@ class StackSpace
 
     bool pushSegmentForInvoke(JSContext *cx, uintN argc, InvokeArgsGuard *ag);
     void popSegmentForInvoke(const InvokeArgsGuard &ag);
 
     bool pushInvokeFrameSlow(JSContext *cx, const InvokeArgsGuard &ag,
                              InvokeFrameGuard *fg);
     void popInvokeFrameSlow(const CallArgs &args);
 
-    bool getSegmentAndFrame(JSContext *cx, uintN vplen, uintN nfixed,
+    bool getSegmentAndFrame(JSContext *cx, uintN vplen, uintN nslots,
                             FrameGuard *fg) const;
     void pushSegmentAndFrame(JSContext *cx, JSFrameRegs *regs, FrameGuard *fg);
     void popSegmentAndFrame(JSContext *cx);
 
     struct EnsureSpaceCheck {
         inline bool operator()(const StackSpace &, JSContext *, Value *, uintN);
     };
 
@@ -723,17 +723,17 @@ class StackSpace
     inline JSStackFrame *getInlineFrame(JSContext *cx, Value *sp, uintN nactual,
                                         JSFunction *fun, JSScript *script,
                                         uint32 *flags) const;
     inline void pushInlineFrame(JSContext *cx, JSScript *script, JSStackFrame *fp,
                                 JSFrameRegs *regs);
     inline void popInlineFrame(JSContext *cx, JSStackFrame *prev, js::Value *newsp);
 
     /* These functions are called inside SendToGenerator. */
-    bool getGeneratorFrame(JSContext *cx, uintN vplen, uintN nfixed,
+    bool getGeneratorFrame(JSContext *cx, uintN vplen, uintN nslots,
                            GeneratorFrameGuard *fg);
     void pushGeneratorFrame(JSContext *cx, JSFrameRegs *regs, GeneratorFrameGuard *fg);
 
     /* Pushes a JSStackFrame::isDummyFrame. */
     bool pushDummyFrame(JSContext *cx, JSObject &scopeChain, DummyFrameGuard *fg);
 
     /* Check and bump the given stack limit. */
     inline JSStackFrame *getInlineFrameWithinLimit(JSContext *cx, Value *sp, uintN nactual,