Bug 496251: use up-to-date typemap when getting upvar from trace entry native frame, r=gal
authorDavid Mandelin <dmandelin@mozilla.com>
Mon, 08 Jun 2009 10:48:18 -0700
changeset 28993 1cfe7ecbb88fb509e32952a3639faa32659dfd46
parent 28992 1f99f42b5382423225b0ab340b3acb5fe9433b09
child 28994 594138cd96e33f84173907066800de071c8ea02a
push id7365
push userrsayre@mozilla.com
push dateTue, 09 Jun 2009 02:39:30 +0000
treeherderautoland@66a40d5fda11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs496251
milestone1.9.2a1pre
Bug 496251: use up-to-date typemap when getting upvar from trace entry native frame, r=gal
js/src/jstracer.cpp
js/src/jstracer.h
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -1898,25 +1898,24 @@ js_GetUpvarOnTrace(JSContext* cx, uint32
              * nativeStackFramePos is the offset of the start of the 
              * activation record corresponding to *fip in the native
              * stack.
              */
             int32 nativeStackFramePos = state->callstackBase[0]->spoffset;
             for (FrameInfo** fip2 = state->callstackBase; fip2 <= fip; fip2++)
                 nativeStackFramePos += (*fip2)->spdist;
             nativeStackFramePos -= (2 + (*fip)->get_argc());
-            uint8* typemap = (uint8*) (fi+1);
             return GetUpvarOnTraceTail(state, cookie, nativeStackFramePos,
-                                       typemap, result);
+                                       fi->get_typemap(), result);
         }
     }
 
     if (state->outermostTree->script->staticLevel == upvarLevel) {
-        return GetUpvarOnTraceTail(state, cookie, 0, 
-                                   state->outermostTree->stackTypeMap(), result);
+        return GetUpvarOnTraceTail(state, cookie, 0, state->callstackBase[0]->get_typemap(), 
+                                   result);
     }
 
     /*
      * If we did not find the upvar in the frames for the active traces,
      * then we simply get the value from the interpreter state.
      */
     jsval v = js_GetUpvar(cx, level, cookie);
     uint8 type = getCoercedType(v);
--- a/js/src/jstracer.h
+++ b/js/src/jstracer.h
@@ -312,16 +312,19 @@ struct FrameInfo {
 
     // Safer accessors for argc.
     enum { CONSTRUCTING_MASK = 0x8000 };
     void   set_argc(uint16 argc, bool constructing) {
         this->argc = argc | (constructing ? CONSTRUCTING_MASK : 0);
     }
     uint16 get_argc() const { return argc & ~CONSTRUCTING_MASK; }
     bool   is_constructing() const { return (argc & CONSTRUCTING_MASK) != 0; }
+
+    // The typemap just before the callee is called.
+    uint8* get_typemap() { return (uint8*) (this+1); }
 };
 
 struct UnstableExit
 {
     nanojit::Fragment* fragment;
     VMSideExit* exit;
     UnstableExit* next;
 };