Backout 596ee431b3d2 (bug 1180874) because of bugs.
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 09 Jul 2015 11:24:54 +0200
changeset 252050 056d1e36d807eb1a4e8063b20557cbbf5d5e5b14
parent 252049 f7caeffbd25223fd831807a0ecfe834c6bf8dfae
child 252051 d299c67518bf97f740a7e96b18abeef83394993d
push id29020
push usercbook@mozilla.com
push dateThu, 09 Jul 2015 15:56:37 +0000
treeherdermozilla-central@d656ef3c4936 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1180874
milestone42.0a1
backs out596ee431b3d25c957fa8389a75f9f36787e2d33e
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout 596ee431b3d2 (bug 1180874) because of bugs.
js/src/jit/x86-shared/Lowering-x86-shared.cpp
--- a/js/src/jit/x86-shared/Lowering-x86-shared.cpp
+++ b/js/src/jit/x86-shared/Lowering-x86-shared.cpp
@@ -166,16 +166,21 @@ LIRGeneratorX86Shared::lowerMulI(MMul* m
     if (mul->fallible())
         assignSnapshot(lir, Bailout_DoubleOutput);
     defineReuseInput(lir, mul, 0);
 }
 
 void
 LIRGeneratorX86Shared::lowerDivI(MDiv* div)
 {
+    if (div->isUnsigned()) {
+        lowerUDiv(div);
+        return;
+    }
+
     // Division instructions are slow. Division by constant denominators can be
     // rewritten to use other instructions.
     if (div->rhs()->isConstant()) {
         int32_t rhs = div->rhs()->toConstant()->value().toInt32();
 
         // Division by powers of two can be done by shifting, and division by
         // other numbers can be done by a reciprocal multiplication technique.
         int32_t shift = FloorLog2(Abs(rhs));
@@ -200,31 +205,31 @@ LIRGeneratorX86Shared::lowerDivI(MDiv* d
             lir = new(alloc()) LDivOrModConstantI(useRegister(div->lhs()), rhs, tempFixed(eax));
             if (div->fallible())
                 assignSnapshot(lir, Bailout_DoubleOutput);
             defineFixed(lir, div, LAllocation(AnyRegister(edx)));
             return;
         }
     }
 
-    if (div->isUnsigned()) {
-        lowerUDiv(div);
-        return;
-    }
-
     LDivI* lir = new(alloc()) LDivI(useRegister(div->lhs()), useRegister(div->rhs()),
                                     tempFixed(edx));
     if (div->fallible())
         assignSnapshot(lir, Bailout_DoubleOutput);
     defineFixed(lir, div, LAllocation(AnyRegister(eax)));
 }
 
 void
 LIRGeneratorX86Shared::lowerModI(MMod* mod)
 {
+    if (mod->isUnsigned()) {
+        lowerUMod(mod);
+        return;
+    }
+
     if (mod->rhs()->isConstant()) {
         int32_t rhs = mod->rhs()->toConstant()->value().toInt32();
         int32_t shift = FloorLog2(Abs(rhs));
         if (rhs != 0 && uint32_t(1) << shift == Abs(rhs)) {
             LModPowTwoI* lir = new(alloc()) LModPowTwoI(useRegisterAtStart(mod->lhs()), shift);
             if (mod->fallible())
                 assignSnapshot(lir, Bailout_DoubleOutput);
             defineReuseInput(lir, mod, 0);
@@ -235,21 +240,16 @@ LIRGeneratorX86Shared::lowerModI(MMod* m
             lir = new(alloc()) LDivOrModConstantI(useRegister(mod->lhs()), rhs, tempFixed(edx));
             if (mod->fallible())
                 assignSnapshot(lir, Bailout_DoubleOutput);
             defineFixed(lir, mod, LAllocation(AnyRegister(eax)));
             return;
         }
     }
 
-    if (mod->isUnsigned()) {
-        lowerUMod(mod);
-        return;
-    }
-
     LModI* lir = new(alloc()) LModI(useRegister(mod->lhs()),
                                     useRegister(mod->rhs()),
                                     tempFixed(eax));
     if (mod->fallible())
         assignSnapshot(lir, Bailout_DoubleOutput);
     defineFixed(lir, mod, LAllocation(AnyRegister(edx)));
 }