Fixed large displacements messing up the tracker on ARM (bug 521190, r=gal).
authorDavid Anderson <danderson@mozilla.com>
Wed, 21 Oct 2009 20:01:16 -0700
changeset 33183 8ebd9899f7182e4279f51fbfe6ee0f014200ee06
parent 33181 34379c7a122f1c3e55282ba1608773443edfbe62
child 33184 1b0526ca92e4db3837cceec82e26a0e60b3fce54
push id808
push userrsayre@mozilla.com
push dateWed, 25 Nov 2009 10:14:46 +0000
reviewersgal
bugs521190
milestone1.9.2b5pre
Fixed large displacements messing up the tracker on ARM (bug 521190, r=gal).
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -3523,27 +3523,35 @@ TraceRecorder::set(jsval* p, LIns* i, bo
     LIns* x = nativeFrameTracker.get(p);
     if (!x) {
         if (isGlobal(p))
             x = writeBack(i, lirbuf->state, nativeGlobalOffset(p), demote);
         else
             x = writeBack(i, lirbuf->sp, -treeInfo->nativeStackBase + nativeStackOffset(p), demote);
         nativeFrameTracker.set(p, x);
     } else {
-#define ASSERT_VALID_CACHE_HIT(base, offset)                                  \
-    JS_ASSERT(base == lirbuf->sp || base == lirbuf->state);                   \
-    JS_ASSERT(offset == ((base == lirbuf->sp)                                 \
-        ? -treeInfo->nativeStackBase + nativeStackOffset(p)                   \
-        : nativeGlobalOffset(p)));                                            \
-
         JS_ASSERT(x->isop(LIR_sti) || x->isop(LIR_stqi));
-        ASSERT_VALID_CACHE_HIT(x->oprnd2(), x->disp());
-        writeBack(i, x->oprnd2(), x->disp(), demote);
-    }
-#undef ASSERT_VALID_CACHE_HIT
+
+        int disp;
+        LIns *base = x->oprnd2();
+#ifdef NANOJIT_ARM
+        if (base->isop(LIR_piadd)) {
+            disp = base->oprnd2()->imm32();
+            base = base->oprnd1();
+        } else
+#endif
+        disp = x->disp();
+
+        JS_ASSERT(base == lirbuf->sp || base == lirbuf->state);
+        JS_ASSERT(disp == ((base == lirbuf->sp) ?
+                  -treeInfo->nativeStackBase + nativeStackOffset(p) :
+                  nativeGlobalOffset(p)));
+
+        writeBack(i, base, disp, demote);
+    }
 }
 
 JS_REQUIRES_STACK LIns*
 TraceRecorder::get(jsval* p)
 {
     JS_ASSERT(known(p));
     checkForGlobalObjectReallocation();
     return tracker.get(p);
@@ -8994,17 +9002,17 @@ TraceRecorder::unbox_jsval(jsval v, LIns
       default:
         JS_ASSERT(JSVAL_TAG(v) == JSVAL_STRING);
         guard(true,
               lir->ins2(LIR_peq,
                         lir->ins2(LIR_piand, v_ins, INS_CONSTWORD(JSVAL_TAGMASK)),
                         INS_CONSTWORD(JSVAL_STRING)),
               exit);
         return lir->ins2(LIR_piand, v_ins, addName(lir->insImmWord(~JSVAL_TAGMASK),
-    					           "~JSVAL_TAGMASK"));
+                                                   "~JSVAL_TAGMASK"));
     }
 }
 
 JS_REQUIRES_STACK JSRecordingStatus
 TraceRecorder::getThis(LIns*& this_ins)
 {
     /*
      * js_ComputeThisForFrame updates cx->fp->argv[-1], so sample it into 'original' first.