Backed out changeset 973ede87dcdd (bug 1092547) for jit-test timeouts in bug977966.js.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 20 Jan 2015 15:10:38 -0500
changeset 242234 dd0c846feacdb3ae51ba64c68020e5a8d64d13ce
parent 242233 c2c0d8f26b9719e5f12b6977773df58c05dcb4ad
child 242235 0c3e94d864fdb70f31af69b5b50b12551c93e3c2
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1092547, 977966
milestone38.0a1
backs out973ede87dcdd56cc6419863269971422cfb43a72
Backed out changeset 973ede87dcdd (bug 1092547) for jit-test timeouts in bug977966.js. CLOSED TREE
js/src/jit-test/tests/ion/dce-with-rinstructions.js
js/src/jit/MIR.h
js/src/jit/Recover.cpp
js/src/jsmath.cpp
js/src/jsmath.h
--- a/js/src/jit-test/tests/ion/dce-with-rinstructions.js
+++ b/js/src/jit-test/tests/ion/dce-with-rinstructions.js
@@ -1072,35 +1072,16 @@ function rsin_object(i) {
     var o = { valueOf: function() { return t; } };
     var x = Math.sin(o);
     t = 777;
     if (uceFault_sin_object(i) || uceFault_sin_object(i))
         assertEq(x, Math.sin(i));
     return i;
 }
 
-var uceFault_log_number = eval(uneval(uceFault).replace('uceFault', 'uceFault_log_number'));
-function rlog_number(i) {
-    var x = Math.log(i);
-    if (uceFault_log_number(i) || uceFault_log_number(i))
-        assertEq(x, Math.log(99) /* log(99) */);
-    return i;
-}
-
-var uceFault_log_object = eval(uneval(uceFault).replace('uceFault', 'uceFault_log_object'));
-function rlog_object(i) {
-    var t = i;
-    var o = { valueOf: function() { return t; } };
-    var x = Math.log(o); /* Evaluated with t == i, not t == 1000 */
-    t = 1000;
-    if (uceFault_log_object(i) || uceFault_log_object(i))
-        assertEq(x, Math.log(99) /* log(99) */);
-    return i;
-}
-
 for (i = 0; i < 100; i++) {
     rbitnot_number(i);
     rbitnot_object(i);
     rbitand_number(i);
     rbitand_object(i);
     rbitor_number(i);
     rbitor_object(i);
     rbitxor_number(i);
@@ -1194,18 +1175,16 @@ for (i = 0; i < 100; i++) {
     rtodouble_value(i);
     rtodouble_number(i);
     rtofloat32_number(i);
     rtofloat32_object(i);
     rhypot_number(i);
     rhypot_object(i);
     rsin_number(i);
     rsin_object(i);
-    rlog_number(i);
-    rlog_object(i);
 }
 
 // Test that we can refer multiple time to the same recover instruction, as well
 // as chaining recover instructions.
 
 function alignedAlloc($size, $alignment) {
     var $1 = $size + 4 | 0;
     var $2 = $alignment - 1 | 0;
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -5711,17 +5711,16 @@ class MMathFunction
         return function_ == Floor || function_ == Ceil || function_ == Round;
     }
     void trySpecializeFloat32(TempAllocator &alloc) MOZ_OVERRIDE;
     void computeRange(TempAllocator &alloc) MOZ_OVERRIDE;
     bool writeRecoverData(CompactBufferWriter &writer) const MOZ_OVERRIDE;
     bool canRecoverOnBailout() const MOZ_OVERRIDE {
         switch(function_) {
           case Sin:
-          case Log:
           case Round:
             return true;
           default:
             return false;
         }
     }
 
     ALLOW_CLONE(MMathFunction)
--- a/js/src/jit/Recover.cpp
+++ b/js/src/jit/Recover.cpp
@@ -905,17 +905,16 @@ bool
 MMathFunction::writeRecoverData(CompactBufferWriter &writer) const
 {
     MOZ_ASSERT(canRecoverOnBailout());
     switch (function_) {
       case Round:
         writer.writeUnsigned(uint32_t(RInstruction::Recover_Round));
         return true;
       case Sin:
-      case Log:
         writer.writeUnsigned(uint32_t(RInstruction::Recover_MathFunction));
         writer.writeByte(function_);
         return true;
       default:
         MOZ_CRASH("Unknown math function.");
     }
 }
 
@@ -933,26 +932,16 @@ RMathFunction::recover(JSContext *cx, Sn
         RootedValue result(cx);
 
         if (!js::math_sin_handle(cx, arg, &result))
             return false;
 
         iter.storeInstructionResult(result);
         return true;
       }
-      case MMathFunction::Log: {
-        RootedValue arg(cx, iter.read());
-        RootedValue result(cx);
-
-        if (!js::math_log_handle(cx, arg, &result))
-            return false;
-
-        iter.storeInstructionResult(result);
-        return true;
-      }
       default:
         MOZ_CRASH("Unknown math function.");
     }
 }
 
 bool
 MStringSplit::writeRecoverData(CompactBufferWriter &writer) const
 {
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -520,55 +520,49 @@ js::math_fround(JSContext *cx, unsigned 
 #else
 #define LOG_IF_OUT_OF_RANGE(x)
 #endif
 
 double
 js::math_log_impl(MathCache *cache, double x)
 {
     LOG_IF_OUT_OF_RANGE(x);
-    return cache->lookup(math_log_uncached, x, MathCache::Log);
+    return cache->lookup(log, x, MathCache::Log);
 }
 
 double
 js::math_log_uncached(double x)
 {
     LOG_IF_OUT_OF_RANGE(x);
     return log(x);
 }
 
 #undef LOG_IF_OUT_OF_RANGE
 
 bool
-js::math_log_handle(JSContext *cx, HandleValue val, MutableHandleValue res)
-{
-    double in;
-    if (!ToNumber(cx, val, &in))
-        return false;
-
-    MathCache *mathCache = cx->runtime()->getMathCache(cx);
-    if (!mathCache)
-        return false;
-
-    double out = math_log_impl(mathCache, in);
-    res.setNumber(out);
-    return true;
-}
-
-bool
 js::math_log(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     if (args.length() == 0) {
         args.rval().setNaN();
         return true;
     }
 
-    return math_log_handle(cx, args[0], args.rval());
+    double x;
+    if (!ToNumber(cx, args[0], &x))
+        return false;
+
+    MathCache *mathCache = cx->runtime()->getMathCache(cx);
+    if (!mathCache)
+        return false;
+
+    double z = math_log_impl(mathCache, x);
+    args.rval().setNumber(z);
+    return true;
 }
 
 double
 js::math_max_impl(double x, double y)
 {
     // Math.max(num, NaN) => NaN, Math.max(-0, +0) => +0
     if (x > y || IsNaN(x) || (x == y && IsNegative(y)))
         return x;
--- a/js/src/jsmath.h
+++ b/js/src/jsmath.h
@@ -166,19 +166,16 @@ math_log(JSContext *cx, unsigned argc, j
 
 extern double
 math_log_impl(MathCache *cache, double x);
 
 extern double
 math_log_uncached(double x);
 
 extern bool
-math_log_handle(JSContext *cx, HandleValue val, MutableHandleValue res);
-
-extern bool
 math_sin(JSContext *cx, unsigned argc, js::Value *vp);
 
 extern double
 math_sin_impl(MathCache *cache, double x);
 
 extern double
 math_sin_uncached(double x);