Bug 864402 - OdinMonkey: int MAdd/MMul should be marked commutative (r=sstangl)

--HG--
extra : rebase_source : 53a771c126bfa101f6b7b5b75c81ce22666728da
This commit is contained in:
Luke Wagner 2013-04-22 16:31:41 -07:00
parent da79205d6c
commit de5a7249f9

View File

@ -3028,8 +3028,10 @@ class MAdd : public MBinaryArithInstruction
MAdd *add = new MAdd(left, right);
add->specialization_ = type;
add->setResultType(type);
if (type == MIRType_Int32)
if (type == MIRType_Int32) {
add->setTruncated(true);
add->setCommutative();
}
return add;
}
void analyzeTruncateBackward();
@ -3101,6 +3103,7 @@ class MMul : public MBinaryArithInstruction
// can never fail and always truncates its output to int32.
canBeNegativeZero_ = false;
setTruncated(true);
setCommutative();
}
JS_ASSERT_IF(mode != Integer, mode == Normal);