Bug 1201793 - return correct result even after bailout, r=nbp, a=ritu
authorLars T Hansen <lhansen@mozilla.com>
Tue, 08 Sep 2015 20:26:27 +0200
changeset 289254 6fa940a15b9328f1b9d8e8826c45242de0ebccf2
parent 289253 ad977f64142b4b00aa0df5d801196ff413f44277
child 289255 e0c5c53a99a9ad69b539b62297393e17743b5403
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp, ritu
bugs1201793
milestone42.0a2
Bug 1201793 - return correct result even after bailout, r=nbp, a=ritu
js/src/jit/arm/CodeGenerator-arm.cpp
--- a/js/src/jit/arm/CodeGenerator-arm.cpp
+++ b/js/src/jit/arm/CodeGenerator-arm.cpp
@@ -541,21 +541,21 @@ CodeGeneratorARM::visitDivI(LDivI* ins)
     MDiv* mir = ins->mir();
 
     Label done;
     divICommon(mir, lhs, rhs, output, ins->snapshot(), done);
 
     if (mir->canTruncateRemainder()) {
         masm.ma_sdiv(lhs, rhs, output);
     } else {
-        masm.ma_sdiv(lhs, rhs, ScratchRegister);
-        masm.ma_mul(ScratchRegister, rhs, temp);
-        masm.ma_cmp(lhs, temp);
+        masm.ma_sdiv(lhs, rhs, temp);
+        masm.ma_mul(temp, rhs, ScratchRegister);
+        masm.ma_cmp(lhs, ScratchRegister);
         bailoutIf(Assembler::NotEqual, ins->snapshot());
-        masm.ma_mov(ScratchRegister, output);
+        masm.ma_mov(temp, output);
     }
 
     masm.bind(&done);
 }
 
 extern "C" {
     extern MOZ_EXPORT int64_t __aeabi_idivmod(int,int);
     extern MOZ_EXPORT int64_t __aeabi_uidivmod(int,int);