Follow-up assertion failure fix for bug 517910. r=me.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 23 Mar 2010 15:49:12 -0700
changeset 40351 0db87fb46cb2d25abf9c198280e1f3258f9f0b2b
parent 40350 31596ada8bfd959580399eaa1a6e741dea37a19b
child 40352 ebee0290c5b3ea6940cae0b381b3cf164367f14e
push id12610
push userrsayre@mozilla.com
push dateMon, 05 Apr 2010 17:26:41 +0000
treeherdermozilla-central@1942c0b4e101 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs517910
milestone1.9.3a3pre
Follow-up assertion failure fix for bug 517910. r=me.
js/src/nanojit/LIR.cpp
--- a/js/src/nanojit/LIR.cpp
+++ b/js/src/nanojit/LIR.cpp
@@ -2299,20 +2299,28 @@ namespace nanojit
             // too because CseFilter relies on LirBufWriter not changing code.
             ins = insLoad(op, ins2(LIR_addp, base, insImmWord(disp)), 0, loadAccSet);
         }
         return ins;
     }
 
     LIns* CseFilter::insStore(LOpcode op, LInsp value, LInsp base, int32_t disp, AccSet accSet)
     {
-        storesSinceLastLoad |= accSet;
-        LIns* ins = out->insStore(op, value, base, disp, accSet);
-        NanoAssert(ins->isop(op) && ins->oprnd1() == value && ins->oprnd2() == base &&
-                   ins->disp() == disp && ins->accSet() == accSet);
+        LInsp ins;
+        if (isS16(disp)) {
+            storesSinceLastLoad |= accSet;
+            ins = out->insStore(op, value, base, disp, accSet);
+            NanoAssert(ins->isop(op) && ins->oprnd1() == value && ins->oprnd2() == base &&
+                       ins->disp() == disp && ins->accSet() == accSet);
+        } else {
+            // If the displacement is more than 16 bits, put it in a separate
+            // instruction.  Nb: LirBufWriter also does this, we do it here
+            // too because CseFilter relies on LirBufWriter not changing code.
+            ins = insStore(op, value, ins2(LIR_addp, base, insImmWord(disp)), 0, accSet);
+        }
         return ins;
     }
 
     LInsp CseFilter::insGuard(LOpcode op, LInsp c, GuardRecord *gr)
     {
         // LIR_xt and LIR_xf guards are CSEable.  Note that we compare the
         // opcode and condition when determining if two guards are equivalent
         // -- in find1() and hash1() -- but we do *not* compare the