Bug 923659 - IonMonkey: Make range adjustments before calling setRange instead of after. r=nbp
authorDan Gohman <sunfish@google.com>
Tue, 15 Oct 2013 20:49:43 -0700
changeset 150868 ea7391a5932319227cafe292122a99e6ae08206a
parent 150867 465f94eb495238c72b56ab54e17845e144a28efe
child 150869 0e58a7a4c393bdd27545c08a19985a95f344a1de
push id25469
push usercbook@mozilla.com
push dateWed, 16 Oct 2013 10:46:01 +0000
treeherderautoland@afae5911a1e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs923659
milestone27.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 923659 - IonMonkey: Make range adjustments before calling setRange instead of after. r=nbp
js/src/jit/RangeAnalysis.cpp
--- a/js/src/jit/RangeAnalysis.cpp
+++ b/js/src/jit/RangeAnalysis.cpp
@@ -1057,20 +1057,20 @@ MUrsh::computeRange()
 
 void
 MAbs::computeRange()
 {
     if (specialization_ != MIRType_Int32 && specialization_ != MIRType_Double)
         return;
 
     Range other(getOperand(0));
-    setRange(Range::abs(&other));
-
+    Range *next = Range::abs(&other);
     if (implicitTruncate_)
-        range()->wrapAroundToInt32();
+        next->wrapAroundToInt32();
+    setRange(next);
 }
 
 void
 MMinMax::computeRange()
 {
     if (specialization_ != MIRType_Int32 && specialization_ != MIRType_Double)
         return;
 
@@ -1082,50 +1082,48 @@ MMinMax::computeRange()
 void
 MAdd::computeRange()
 {
     if (specialization() != MIRType_Int32 && specialization() != MIRType_Double)
         return;
     Range left(getOperand(0));
     Range right(getOperand(1));
     Range *next = Range::add(&left, &right);
+    if (isTruncated())
+        next->wrapAroundToInt32();
     setRange(next);
-
-    if (isTruncated())
-        range()->wrapAroundToInt32();
 }
 
 void
 MSub::computeRange()
 {
     if (specialization() != MIRType_Int32 && specialization() != MIRType_Double)
         return;
     Range left(getOperand(0));
     Range right(getOperand(1));
     Range *next = Range::sub(&left, &right);
+    if (isTruncated())
+        next->wrapAroundToInt32();
     setRange(next);
-
-    if (isTruncated())
-        range()->wrapAroundToInt32();
 }
 
 void
 MMul::computeRange()
 {
     if (specialization() != MIRType_Int32 && specialization() != MIRType_Double)
         return;
     Range left(getOperand(0));
     Range right(getOperand(1));
     if (canBeNegativeZero())
         canBeNegativeZero_ = Range::negativeZeroMul(&left, &right);
-    setRange(Range::mul(&left, &right));
-
+    Range *next = Range::mul(&left, &right);
     // Truncated multiplications could overflow in both directions
     if (isTruncated())
-        range()->wrapAroundToInt32();
+        next->wrapAroundToInt32();
+    setRange(next);
 }
 
 void
 MMod::computeRange()
 {
     if (specialization() != MIRType_Int32 && specialization() != MIRType_Double)
         return;
     Range lhs(getOperand(0));