tighten up some bounds, still not quite right
authorshaver@mozilla.org
Wed, 23 Jul 2008 11:42:52 -0400
changeset 17810 58268341e59090e24eb96b8ab4116d675732eec7
parent 17809 74c74142691de291bfa8790dad6e81416cbf22ae
child 17812 7f3cc9a4bf1a39d823ef4f1a3bcbc8ecafe0553e
push id1452
push usershaver@mozilla.com
push dateFri, 22 Aug 2008 00:08:22 +0000
treeherderautoland@d13bb0868596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
tighten up some bounds, still not quite right
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -421,17 +421,17 @@ public:
             if (f->callee) {                                                  \
                 SET_VPNAME("this");                                           \
                 vp = &f->argv[-1];                                            \
                 code;                                                         \
                 SET_VPNAME("argv");                                           \
                 vp = &f->argv[0]; vpstop = &f->argv[f->fun->nargs];           \
                 while (vp < vpstop) { code; ++vp; INC_VPNUM(); }              \
                 SET_VPNAME("vars");                                           \
-                vp = &f->slots[0]; vpstop = &f->slots[f->script->nslots];     \
+                vp = f->slots; vpstop = &f->slots[f->script->nfixed];         \
                 while (vp < vpstop) { code; ++vp; INC_VPNUM(); }              \
             }                                                                 \
             SET_VPNAME("stack");                                              \
             vp = StackBase(f); vpstop = f->regs->sp;                          \
             while (vp < vpstop) { code; ++vp; INC_VPNUM(); }                  \
         }                                                                     \
     JS_END_MACRO
 
@@ -572,17 +572,17 @@ findInternableGlobals(JSContext* cx, JSS
    all the way back to the entry frame, including the current stack usage. */
 static unsigned nativeFrameSlots(unsigned ngslots, unsigned callDepth, 
         JSStackFrame* fp, JSFrameRegs& regs)
 {
     unsigned slots = ngslots;
     for (;;) {
         slots += 1/*rval*/ + (regs.sp - StackBase(fp));
         if (fp->callee)
-            slots += 1/*this*/ + fp->fun->nargs + fp->script->nslots;
+            slots += 1/*this*/ + fp->fun->nargs + fp->script->nfixed;
         if (callDepth-- == 0)
             return slots;
         fp = fp->down;
     }
     JS_NOT_REACHED("nativeFrameSlots");
 }
 
 /* Determine the offset in the native frame (marshal) for an address
@@ -1329,25 +1329,26 @@ TraceRecorder::argval(unsigned n) const
 {
     JS_ASSERT(n < cx->fp->fun->nargs);
     return cx->fp->argv[n];
 }
 
 jsval&
 TraceRecorder::varval(unsigned n) const
 {
-    JS_ASSERT(n < cx->fp->script->nslots);
+    JS_ASSERT(n < cx->fp->script->nfixed);
     return cx->fp->slots[n];
 }
 
 jsval&
 TraceRecorder::stackval(int n) const
 {
     jsval* sp = cx->fp->regs->sp;
-    JS_ASSERT(size_t((sp + n) - StackBase(cx->fp)) < cx->fp->script->nslots);
+    JS_ASSERT(size_t((sp + n) - StackBase(cx->fp)) < 
+              cx->fp->script->nslots - cx->fp->script->nfixed);
     return sp[n];
 }
 
 LIns*
 TraceRecorder::arg(unsigned n)
 {
     return get(&argval(n));
 }
@@ -2321,17 +2322,17 @@ bool TraceRecorder::record_JSOP_CALL()
 bool
 TraceRecorder::record_EnterFrame()
 {
     ++callDepth;
     JSStackFrame* fp = cx->fp;
     LIns* void_ins = lir->insImm(JSVAL_TO_BOOLEAN(JSVAL_VOID));
     set(&fp->rval, void_ins, true);
     unsigned n;
-    for (n = 0; n < fp->script->nslots; ++n)
+    for (n = 0; n < fp->script->nfixed; ++n)
         set(&fp->slots[n], void_ins, true);
     return true;
 }
 
 bool
 TraceRecorder::prop(JSObject* obj, LIns* obj_ins, uint32& slot, LIns*& v_ins)
 {
     /*