Bug 835578 - IonMonkey: fix visitCompare/visitTest to not useRegister on constant operands (r=dvander)
authorLuke Wagner <luke@mozilla.com>
Tue, 29 Jan 2013 08:29:51 -0800
changeset 120238 a16bd9c186009054b07ec7b41095f6c0f9965fae
parent 120237 456d199b8d1fc061407bc1e75d9920de8e8c3e83
child 120239 0a5bf147e0e6f4af683d46c679fe326f74d6d384
push id24243
push userryanvm@gmail.com
push dateWed, 30 Jan 2013 00:49:21 +0000
treeherdermozilla-central@5c248ef0fe62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs835578
milestone21.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 835578 - IonMonkey: fix visitCompare/visitTest to not useRegister on constant operands (r=dvander)
js/src/ion/Lowering.cpp
--- a/js/src/ion/Lowering.cpp
+++ b/js/src/ion/Lowering.cpp
@@ -495,19 +495,21 @@ LIRGenerator::visitTest(MTest *test)
         }
 
         // Compare and branch Int32 or Object pointers.
         if (comp->compareType() == MCompare::Compare_Int32 ||
             comp->compareType() == MCompare::Compare_Object)
         {
             JSOp op = ReorderComparison(comp->jsop(), &left, &right);
             LAllocation lhs = useRegister(left);
-            LAllocation rhs = useRegister(right);
+            LAllocation rhs;
             if (comp->compareType() == MCompare::Compare_Int32)
                 rhs = useAnyOrConstant(right);
+            else
+                rhs = useRegister(right);
             LCompareAndBranch *lir = new LCompareAndBranch(op, lhs, rhs, ifTrue, ifFalse);
             return add(lir, comp);
         }
 
         // Compare and branch doubles.
         if (comp->compareType() == MCompare::Compare_Double) {
             LAllocation lhs = useRegister(left);
             LAllocation rhs = useRegister(right);
@@ -639,19 +641,21 @@ LIRGenerator::visitCompare(MCompare *com
     }
 
     // Compare Int32 or Object pointers.
     if (comp->compareType() == MCompare::Compare_Int32 ||
         comp->compareType() == MCompare::Compare_Object)
     {
         JSOp op = ReorderComparison(comp->jsop(), &left, &right);
         LAllocation lhs = useRegister(left);
-        LAllocation rhs = useRegister(right);
+        LAllocation rhs;
         if (comp->compareType() == MCompare::Compare_Int32)
             rhs = useAnyOrConstant(right);
+        else
+            rhs = useRegister(right);
         return define(new LCompare(op, lhs, rhs), comp);
     }
 
     // Compare doubles.
     if (comp->compareType() == MCompare::Compare_Double)
         return define(new LCompareD(useRegister(left), useRegister(right)), comp);
 
     // Compare values.