Bug 923659 - IonMonkey: Use null instead of allocating a Range when nothing is known. r=nbp
authorDan Gohman <sunfish@google.com>
Tue, 15 Oct 2013 20:49:43 -0700
changeset 150865 22e6f21251c929738ed884970d4c011c032dff18
parent 150864 4a67b5951c2313f6df4e42044417e68dee452342
child 150866 21f1754f307bbcb16847cc296ca2665a70d94b46
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: Use null instead of allocating a Range when nothing is known. r=nbp
js/src/jit/RangeAnalysis.cpp
--- a/js/src/jit/RangeAnalysis.cpp
+++ b/js/src/jit/RangeAnalysis.cpp
@@ -755,32 +755,32 @@ Range::abs(const Range *op)
                      op->max_exponent_);
 }
 
 Range *
 Range::min(const Range *lhs, const Range *rhs)
 {
     // If either operand is NaN, the result is NaN.
     if (lhs->canBeNaN() || rhs->canBeNaN())
-        return new Range();
+        return nullptr;
 
     return new Range(Min(lhs->lower_, rhs->lower_),
                      lhs->hasInt32LowerBound_ && rhs->hasInt32LowerBound_,
                      Min(lhs->upper_, rhs->upper_),
                      lhs->hasInt32UpperBound_ || rhs->hasInt32UpperBound_,
                      lhs->canHaveFractionalPart_ || rhs->canHaveFractionalPart_,
                      Max(lhs->max_exponent_, rhs->max_exponent_));
 }
 
 Range *
 Range::max(const Range *lhs, const Range *rhs)
 {
     // If either operand is NaN, the result is NaN.
     if (lhs->canBeNaN() || rhs->canBeNaN())
-        return new Range();
+        return nullptr;
 
     return new Range(Max(lhs->lower_, rhs->lower_),
                      lhs->hasInt32LowerBound_ || rhs->hasInt32LowerBound_,
                      Max(lhs->upper_, rhs->upper_),
                      lhs->hasInt32UpperBound_ && rhs->hasInt32UpperBound_,
                      lhs->canHaveFractionalPart_ || rhs->canHaveFractionalPart_,
                      Max(lhs->max_exponent_, rhs->max_exponent_));
 }