From de5a7249f912f5d1166f7831e3c0f4f1b9998210 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Mon, 22 Apr 2013 16:31:41 -0700 Subject: [PATCH] Bug 864402 - OdinMonkey: int MAdd/MMul should be marked commutative (r=sstangl) --HG-- extra : rebase_source : 53a771c126bfa101f6b7b5b75c81ce22666728da --- js/src/ion/MIR.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 644fb187683..5db622c74b6 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -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);