Bug 876607 - Fix accidental switching of lhs/rhs in the code, rs=luke
authorHannes Verschore <hv1989@gmail.com>
Sat, 08 Jun 2013 00:34:16 +0200
changeset 145919 22ed321f3fbe1eecb8a42d26387098c7b4187f48
parent 145918 a8e61d04f7866b45f03156a06034b55ad212ca53
child 145920 3854819a064bfaa32615305d287f505984d2ab13
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs876607
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 876607 - Fix accidental switching of lhs/rhs in the code, rs=luke
js/src/ion/Lowering.cpp
--- a/js/src/ion/Lowering.cpp
+++ b/js/src/ion/Lowering.cpp
@@ -858,17 +858,17 @@ ReorderCommutative(MDefinition **lhsp, M
     // Ensure that if there is a constant, then it is in rhs.
     // In addition, since clobbering binary operations clobber the left
     // operand, prefer a non-constant lhs operand with no further uses.
 
     if (rhs->isConstant())
         return;
 
     if (lhs->isConstant() ||
-        (lhs->defUseCount() == 1 && rhs->defUseCount() != 1))
+        (rhs->defUseCount() == 1 && lhs->defUseCount() > 1))
     {
         *rhsp = lhs;
         *lhsp = rhs;
     }
 }
 
 bool
 LIRGenerator::lowerBitOp(JSOp op, MInstruction *ins)