Bug 1011283 - IonMonkey: Disable the DivOrModConstantI optimization. r=nbp, a=sledru
--- 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;