Bug 1011283 - IonMonkey: Disable the DivOrModConstantI optimization. r=nbp, a=sledru
authorDan Gohman <sunfish@mozilla.com>
Mon, 23 Jun 2014 16:50:40 -0400
changeset 207240 913b7be0707c4c1a523c773a0299cd8be7aca90f
parent 207239 5e99d7c9658a2bf0fa51bf4bbac6d93c788cc0ed
child 207241 1a06329ebf36380961e4966852d6f1d6be90cd63
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp, sledru
bugs1011283
milestone32.0a2
Bug 1011283 - IonMonkey: Disable the DivOrModConstantI optimization. r=nbp, a=sledru
js/src/jit/shared/Lowering-x86-shared.cpp
--- a/js/src/jit/shared/Lowering-x86-shared.cpp
+++ b/js/src/jit/shared/Lowering-x86-shared.cpp
@@ -150,22 +150,16 @@ LIRGeneratorX86Shared::lowerDivI(MDiv *d
             } else {
                 // Numerator is signed, and needs adjusting, and an extra
                 // lhs copy register is needed.
                 lir = new(alloc()) LDivPowTwoI(lhs, useRegister(div->lhs()), shift, rhs < 0);
             }
             if (div->fallible() && !assignSnapshot(lir, Bailout_BaselineInfo))
                 return false;
             return defineReuseInput(lir, div, 0);
-        } else if (rhs != 0) {
-            LDivOrModConstantI *lir;
-            lir = new(alloc()) LDivOrModConstantI(useRegister(div->lhs()), rhs, tempFixed(eax));
-            if (div->fallible() && !assignSnapshot(lir, Bailout_BaselineInfo))
-                return false;
-            return defineFixed(lir, div, LAllocation(AnyRegister(edx)));
         }
     }
 
     LDivI *lir = new(alloc()) LDivI(useRegister(div->lhs()), useRegister(div->rhs()),
                                     tempFixed(edx));
     if (div->fallible() && !assignSnapshot(lir, Bailout_BaselineInfo))
         return false;
     return defineFixed(lir, div, LAllocation(AnyRegister(eax)));
@@ -180,22 +174,16 @@ LIRGeneratorX86Shared::lowerModI(MMod *m
     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_BaselineInfo))
                 return false;
             return defineReuseInput(lir, mod, 0);
-        } else if (rhs != 0) {
-            LDivOrModConstantI *lir;
-            lir = new(alloc()) LDivOrModConstantI(useRegister(mod->lhs()), rhs, tempFixed(edx));
-            if (mod->fallible() && !assignSnapshot(lir, Bailout_BaselineInfo))
-                return false;
-            return defineFixed(lir, mod, LAllocation(AnyRegister(eax)));
         }
     }
 
     LModI *lir = new(alloc()) LModI(useRegister(mod->lhs()),
                                     useRegister(mod->rhs()),
                                     tempFixed(eax));
     if (mod->fallible() && !assignSnapshot(lir, Bailout_BaselineInfo))
         return false;