Bug 1204700 - ARM: Use a different scratch register for store32. r=sstangl, a=sylvestre
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 15 Oct 2015 10:57:39 +0200
changeset 289547 ebafbc7c1a87
parent 289546 b09a797a251b
child 289548 8987abaa7231
push id5179
push usercbook@mozilla.com
push date2015-10-15 09:17 +0000
treeherdermozilla-beta@ebafbc7c1a87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl, sylvestre
bugs1204700
milestone42.0
Bug 1204700 - ARM: Use a different scratch register for store32. r=sstangl, a=sylvestre
js/src/jit/arm/MacroAssembler-arm.cpp
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -2397,29 +2397,29 @@ MacroAssemblerARMCompat::store32(Imm32 s
 {
     move32(src, secondScratchReg_);
     storePtr(secondScratchReg_, address);
 }
 
 void
 MacroAssemblerARMCompat::store32(Imm32 imm, const BaseIndex& dest)
 {
-    ma_mov(imm, secondScratchReg_);
-    store32(secondScratchReg_, dest);
+    ma_mov(imm, ScratchRegister);
+    store32(ScratchRegister, dest);
 }
 
 void
 MacroAssemblerARMCompat::store32(Register src, const BaseIndex& dest)
 {
     Register base = dest.base;
     uint32_t scale = Imm32::ShiftOf(dest.scale).value;
 
     if (dest.offset != 0) {
-        ma_add(base, Imm32(dest.offset), ScratchRegister);
-        base = ScratchRegister;
+        ma_add(base, Imm32(dest.offset), secondScratchReg_);
+        base = secondScratchReg_;
     }
     ma_str(src, DTRAddr(base, DtrRegImmShift(dest.index, LSL, scale)));
 }
 
 void
 MacroAssemblerARMCompat::store32_NoSecondScratch(Imm32 src, const Address& address)
 {
     move32(src, ScratchRegister);