remove rval tracking, since it's no longer necessary
authorshaver@mozilla.org
Sun, 27 Jul 2008 15:47:43 -0400
changeset 17844 f5e9534513710c4f703b3e7b0df98b2fb9311466
parent 17843 ee5bf68b0025791cbe4b43a501ed5f9ddeabbe1e
child 17846 ed83a368ff1974b06acb1e3315b58c9309919bf6
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
remove rval tracking, since it's no longer necessary
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -387,19 +387,21 @@ public:
         SET_VPNAME("global");                                                 \
         for (n = 0; n < ngslots; ++n) {                                       \
             vp = &STOBJ_GET_SLOT(globalObj, gslots[n]);                       \
             { code; }                                                         \
             INC_VPNUM();                                                      \
         }                                                                     \
     JS_END_MACRO
 
-/* This macro can be used to iterate over all slots in currently pending
-   frames that make up the native frame, consisting of rval, args, vars,
-   and stack (except for the top-level frame which does not have args or vars. */
+/* 
+ * This macro can be used to iterate over all slots in currently pending
+ * frames that make up the native frame, consisting of args, vars, and stack
+ * (except for the top-level frame which does not have args or vars
+*/
 #define FORALL_SLOTS_IN_PENDING_FRAMES(cx, callDepth, code)                   \
     JS_BEGIN_MACRO                                                            \
         DEF_VPNAME;                                                           \
         unsigned n;                                                           \
         jsval* vp;                                                            \
         JSStackFrame* currentFrame = cx->fp;                                  \
         JSStackFrame* entryFrame;                                             \
         JSStackFrame* fp = currentFrame;                                      \
@@ -409,18 +411,16 @@ public:
         JSStackFrame** fstack = (JSStackFrame **)alloca(frames * sizeof (JSStackFrame *)); \
         JSStackFrame** fspstop = &fstack[frames];                             \
         JSStackFrame** fsp = fspstop-1;                                       \
         fp = currentFrame;                                                    \
         for (;; fp = fp->down) { *fsp-- = fp; if (fp == entryFrame) break; }  \
         for (fsp = fstack; fsp < fspstop; ++fsp) {                            \
             JSStackFrame* f = *fsp;                                           \
             jsval* vpstop;                                                    \
-            SET_VPNAME("rval");                                               \
-            vp = &f->rval; code;                                              \
             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");                                           \
@@ -580,17 +580,17 @@ findInternableGlobals(JSContext* cx, JSS
 
 /* Calculate the total number of native frame slots we need from this frame
    all the way back to the entry frame, including the current stack usage. */
 static unsigned nativeStackSlots(unsigned callDepth,
         JSStackFrame* fp, JSFrameRegs& regs)
 {
     unsigned slots = 0;
     for (;;) {
-        slots += 1/*rval*/ + (regs.sp - StackBase(fp));
+        slots += (regs.sp - StackBase(fp));
         if (fp->callee)
             slots += 1/*this*/ + fp->fun->nargs + fp->script->nfixed;
         if (callDepth-- == 0)
             return slots;
         fp = fp->down;
     }
     JS_NOT_REACHED("nativeFrameSlots");
 }
@@ -636,19 +636,16 @@ done:
     unsigned frames = callDepth+1;
     JSStackFrame** fstack = (JSStackFrame **)alloca(frames * sizeof (JSStackFrame *));
     JSStackFrame** fspstop = &fstack[frames];
     JSStackFrame** fsp = fspstop-1;
     fp = currentFrame;
     for (;; fp = fp->down) { *fsp-- = fp; if (fp == entryFrame) break; }
     for (fsp = fstack; fsp < fspstop; ++fsp) {
         JSStackFrame* f = *fsp;
-        if (p == &f->rval)
-            RETURN(offset);
-        offset += sizeof(double);
         if (f->callee) {
             if (size_t(p - &f->argv[-1]) < (unsigned)f->fun->nargs+1)
                 RETURN(offset + size_t(p - &f->argv[-1]) * sizeof(double));
             offset += (f->fun->nargs+1) * sizeof(double);
             if (size_t(p - &f->slots[0]) < f->script->nfixed)
                 RETURN(offset + size_t(p - &f->slots[0]) * sizeof(double));
             offset += f->script->nfixed * sizeof(double);
         }
@@ -1927,62 +1924,59 @@ bool TraceRecorder::guardDenseArrayIndex
 void
 TraceRecorder::clearFrameSlotsFromCache()
 {
     /* Clear out all slots of this frame in the nativeFrameTracker. Different locations on the
        VM stack might map to different locations on the native stack depending on the
        number of arguments (i.e.) of the next call, so we have to make sure we map
        those in to the cache with the right offsets. */
     JSStackFrame* fp = cx->fp;
-    nativeFrameTracker.set(&fp->rval, (LIns*)0);
     jsval* vp;
     jsval* vpstop;
     for (vp = &fp->argv[-1], vpstop = &fp->argv[fp->fun->nargs]; vp < vpstop; ++vp)
         nativeFrameTracker.set(vp, (LIns*)0);
     for (vp = &fp->slots[0], vpstop = &fp->slots[fp->script->nslots]; vp < vpstop; ++vp)
         nativeFrameTracker.set(vp, (LIns*)0);
 }
 
 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->nfixed; ++n)
         set(&fp->slots[n], void_ins, true);
     return true;
 }
 
 bool
 TraceRecorder::record_LeaveFrame()
 {
     if (callDepth-- <= 0)
         return false;
     atoms = cx->fp->script->atomMap.vector;
-    stack(-1, rval_ins); // LeaveFrame gets called after the interpreter stored rval so -1, not 0
+    stack(-1, rval_ins); // LeaveFrame gets called after the interpreter stored rval, so -1 not 0
     return true;
 }
 
 bool TraceRecorder::record_JSOP_INTERRUPT()
 {
     return false;
 }
 bool TraceRecorder::record_JSOP_PUSH()
 {
     stack(0, lir->insImm(JSVAL_TO_BOOLEAN(JSVAL_VOID)));
     return true;
 }
 bool TraceRecorder::record_JSOP_POPV()
 {
-    jsval& v = stackval(-1);
-    set(&cx->fp->rval, get(&v));
-    return true;
+    // If we implement this, we need to update JSOP_STOP.
+    return false;
 }
 bool TraceRecorder::record_JSOP_ENTERWITH()
 {
     return false;
 }
 bool TraceRecorder::record_JSOP_LEAVEWITH()
 {
     return false;
@@ -2991,16 +2985,17 @@ bool TraceRecorder::record_JSOP_BACKPATC
     return true;
 }
 bool TraceRecorder::record_JSOP_THROWING()
 {
     return false;
 }
 bool TraceRecorder::record_JSOP_SETRVAL()
 {
+    // If we implement this, we need to update JSOP_STOP.
     return false;
 }
 bool TraceRecorder::record_JSOP_RETRVAL()
 {
     return false;
 }
 bool TraceRecorder::record_JSOP_GETGVAR()
 {
@@ -3231,17 +3226,18 @@ bool TraceRecorder::record_JSOP_STARTXML
 
 bool TraceRecorder::record_JSOP_CALLELEM()
 {
     return false;
 }
 
 bool TraceRecorder::record_JSOP_STOP()
 {
-    rval_ins = get(&cx->fp->rval);
+    // Update this when we implement POPV.
+    rval_ins = lir->insImm(JSVAL_TO_BOOLEAN(JSVAL_VOID));
     clearFrameSlotsFromCache();
     return true;
 }
 
 bool TraceRecorder::record_JSOP_GETXPROP()
 {
     jsval& l = stackval(-1);
     if (JSVAL_IS_PRIMITIVE(l))