Bug 1204700 - ARM: Use a different scratch register for store32. r=sstangl, a=sylvestre
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Mon, 12 Oct 2015 20:21:07 +0200
changeset 296443 b14beb29be004b11792f302e85ad37053abbf641
parent 296442 e1693911e3c44d7fb11adb78a9da005058721e63
child 296444 ae10da57b8db95b2be46f9c40b6ad196337e1096
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl, sylvestre
bugs1204700
milestone43.0a2
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
@@ -2337,32 +2337,32 @@ MacroAssemblerARMCompat::store32(Imm32 s
     AutoRegisterScope scratch2(asMasm(), secondScratchReg_);
     move32(src, scratch2);
     storePtr(scratch2, address);
 }
 
 void
 MacroAssemblerARMCompat::store32(Imm32 imm, const BaseIndex& dest)
 {
-    AutoRegisterScope scratch2(asMasm(), secondScratchReg_);
-    ma_mov(imm, scratch2);
-    store32(scratch2, dest);
+    ScratchRegisterScope scratch(asMasm());
+    ma_mov(imm, scratch);
+    store32(scratch, dest);
 }
 
 void
 MacroAssemblerARMCompat::store32(Register src, const BaseIndex& dest)
 {
     Register base = dest.base;
     uint32_t scale = Imm32::ShiftOf(dest.scale).value;
 
-    ScratchRegisterScope scratch(asMasm());
+    AutoRegisterScope scratch2(asMasm(), secondScratchReg_);
 
     if (dest.offset != 0) {
-        ma_add(base, Imm32(dest.offset), scratch);
-        base = scratch;
+        ma_add(base, Imm32(dest.offset), scratch2);
+        base = scratch2;
     }
     ma_str(src, DTRAddr(base, DtrRegImmShift(dest.index, LSL, scale)));
 }
 
 void
 MacroAssemblerARMCompat::store32_NoSecondScratch(Imm32 src, const Address& address)
 {
     // move32() needs to use the ScratchRegister internally, but there is no additional