Bug 1315640: Split unnecessary loop into linear code; r?nbp
MozReview-Commit-ID: 9EExrHvQqac
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -2794,21 +2794,20 @@ MBinaryBitwiseInstruction::foldUnnecessa
{
if (specialization_ != MIRType::Int32)
return this;
// Fold unsigned shift right operator when the second operand is zero and
// the only use is an unsigned modulo. Thus, the expression
// |(x >>> 0) % y| becomes |x % y|.
if (isUrsh() && hasOneDefUse() && IsUint32Type(this)) {
- for (MUseDefIterator use(this); use; use++) {
- if (use.def()->isMod() && use.def()->toMod()->isUnsigned())
- return getOperand(0);
- break;
- }
+ MUseDefIterator use(this);
+ if (use.def()->isMod() && use.def()->toMod()->isUnsigned())
+ return getOperand(0);
+ MOZ_ASSERT(!(++use));
}
// Eliminate bitwise operations that are no-ops when used on integer
// inputs, such as (x | 0).
MDefinition* lhs = getOperand(0);
MDefinition* rhs = getOperand(1);