b=481351; TM ARM crash in js_FastNewObject while logging in to gmail (bad constant-offset load codegen) [ARM ONLY]; r=graydon
authorVladimir Vukicevic <vladimir@pobox.com>
Wed, 04 Mar 2009 22:36:22 -0800
changeset 25753 997d21a3667afbafd6598cbce924b9b9d89e5f25
parent 25752 5dacfaef8896d5d217f1f406c8117617c6b44cdc
child 25754 5e81fbdd55e4be3884f8aca0c337f0c7a3c9b074
push id5725
push uservladimir@mozilla.com
push dateThu, 05 Mar 2009 06:41:39 +0000
treeherdermozilla-central@997d21a3667a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgraydon
bugs481351
milestone1.9.2a1pre
b=481351; TM ARM crash in js_FastNewObject while logging in to gmail (bad constant-offset load codegen) [ARM ONLY]; r=graydon
js/src/nanojit/NativeARM.h
--- a/js/src/nanojit/NativeARM.h
+++ b/js/src/nanojit/NativeARM.h
@@ -492,30 +492,24 @@ typedef enum {
 #define MRA(dr,sr)  MR_cond(dr, sr, HI, "movcs")
 #define MRAE(dr,sr) MR_cond(dr, sr, CS, "movhi")
 #define MRNO(dr,sr) MR_cond(dr, sr, VC, "movvc") // overflow clear
 #define MRNC(dr,sr) MR_cond(dr, sr, CC, "movcc") // carry clear
 
 #define LDR_chk(_d,_b,_off,_chk) do {                                   \
         if (IsFpReg(_d)) {                                              \
             FLDD_chk(_d,_b,_off,_chk);                                  \
-        } else if ((_off)<0) {                                          \
+        } else if ((_off) > -4096 && (_off) < 4096) {                   \
             if (_chk) underrunProtect(4);                               \
-            NanoAssert((_off)>-4096);                                   \
-            *(--_nIns) = (NIns)( COND_AL | (0x51<<20) | ((_b)<<16) | ((_d)<<12) | ((-(_off))&0xFFF) ); \
+            *(--_nIns) = (NIns)( COND_AL | (((_off) < 0 ? 0x51 : 0x59)<<20) | ((_b)<<16) | ((_d)<<12) | (((_off) < 0 ? -(_off) : (_off))&0xFFF) ); \
         } else {                                                        \
-            if (isS16(_off) || isU16(_off)) {                           \
-                if (_chk) underrunProtect(4);                           \
-                NanoAssert((_off)<4096);                                \
-                *(--_nIns) = (NIns)( COND_AL | (0x59<<20) | ((_b)<<16) | ((_d)<<12) | ((_off)&0xFFF) ); \
-            } else {                                                    \
-                if (_chk) underrunProtect(4+LD32_size);                 \
-                *(--_nIns) = (NIns)( COND_AL | (0x79<<20) | ((_b)<<16) | ((_d)<<12) | Scratch ); \
-                LD32_nochk(Scratch, _off);                              \
-            }                                                           \
+            if (_chk) underrunProtect(4+LD32_size);                     \
+            NanoAssert((_b) != IP);                                     \
+            *(--_nIns) = (NIns)( COND_AL | (0x79<<20) | ((_b)<<16) | ((_d)<<12) | Scratch ); \
+            LD32_nochk(Scratch, _off);                                  \
         }                                                               \
         asm_output("ldr %s, [%s, #%d]",gpn(_d),gpn(_b),(_off));        \
     } while(0)
 
 #define LDR(_d,_b,_off)        LDR_chk(_d,_b,_off,1)
 #define LDR_nochk(_d,_b,_off)  LDR_chk(_d,_b,_off,0)
 
 // i386 compat, for Assembler.cpp