Bug 1147405: Have math_ceil_handle use setNumber rather than setDouble; r=nbp
authorBenjamin Bouvier <benj@benj.me>
Thu, 26 Mar 2015 15:44:55 +0100
changeset 236052 366c8ef076488ed6fe2f158d4a65d47bb7013153
parent 236051 46e3f17440a755eef4feb276f779d4d11f771f96
child 236053 2713e4e8e549474c06b6645fc0722ec1fd72c5b4
push id57584
push userbenj@benj.me
push dateFri, 27 Mar 2015 12:40:55 +0000
treeherdermozilla-inbound@366c8ef07648 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1147405
milestone39.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 1147405: Have math_ceil_handle use setNumber rather than setDouble; r=nbp
js/src/jit-test/tests/ion/dce-with-rinstructions.js
js/src/jsmath.cpp
--- a/js/src/jit-test/tests/ion/dce-with-rinstructions.js
+++ b/js/src/jit-test/tests/ion/dce-with-rinstructions.js
@@ -414,19 +414,18 @@ function rfloor_object(i) {
     assertRecoveredOnBailout(x, false);
     return i;
 }
 
 var uceFault_ceil_number = eval(uneval(uceFault).replace('uceFault', 'uceFault_ceil_number'));
 function rceil_number(i) {
     var x = Math.ceil(-i - 0.12010799100);
     if (uceFault_ceil_number(i) || uceFault_ceil_number(i))
-        assertEq(x, - i);
-    // NYI: uses MMathFunction and not MCeil.
-    // assertRecoveredOnBailout(x, true);
+        assertEq(x, -i);
+    assertRecoveredOnBailout(x, true);
     return i;
 }
 
 var uceFault_round_number = eval(uneval(uceFault).replace('uceFault', 'uceFault_round'));
 function rround_number(i) {
     var x = Math.round(i + 1.4);
     if (uceFault_round_number(i) || uceFault_round_number(i))
         assertEq(x, 100); /* = i + 1*/
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -308,17 +308,17 @@ js::math_ceil_impl(double x)
 bool
 js::math_ceil_handle(JSContext *cx, HandleValue v, MutableHandleValue res)
 {
     double d;
     if(!ToNumber(cx, v, &d))
         return false;
 
     double result = math_ceil_impl(d);
-    res.setDouble(result);
+    res.setNumber(result);
     return true;
 }
 
 bool
 js::math_ceil(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);