Bug 1498303: Relax restrictions on pending exceptions in math functions called from recovery code r=tcampbell
authorIain Ireland <iireland@mozilla.com>
Thu, 11 Oct 2018 21:30:18 +0000
changeset 496504 48b41b195cae79cae4aff526bd3c8b959f325185
parent 496503 f8d429e8d630e4ab2b6936815ce07b07b8187cec
child 496505 90b00e89e83e5eb07baf20dc55a8a141d8f242af
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1498303
milestone64.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 1498303: Relax restrictions on pending exceptions in math functions called from recovery code r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D8448
js/src/jsmath.cpp
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -457,17 +457,17 @@ bool
 js::math_log(JSContext* cx, unsigned argc, Value* vp)
 {
     return math_function<math_log_impl>(cx, argc, vp);
 }
 
 double
 js::math_max_impl(double x, double y)
 {
-    AutoUnsafeCallWithABI unsafe;
+    AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
 
     // Math.max(num, NaN) => NaN, Math.max(-0, +0) => +0
     if (x > y || IsNaN(x) || (x == y && IsNegative(y))) {
         return x;
     }
     return y;
 }
 
@@ -486,17 +486,17 @@ js::math_max(JSContext* cx, unsigned arg
     }
     args.rval().setNumber(maxval);
     return true;
 }
 
 double
 js::math_min_impl(double x, double y)
 {
-    AutoUnsafeCallWithABI unsafe;
+    AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
 
     // Math.min(num, NaN) => NaN, Math.min(-0, +0) => -0
     if (x < y || IsNaN(x) || (x == y && IsNegativeZero(x))) {
         return x;
     }
     return y;
 }
 
@@ -972,17 +972,17 @@ bool
 js::math_atanh(JSContext* cx, unsigned argc, Value* vp)
 {
     return math_function<math_atanh_impl>(cx, argc, vp);
 }
 
 double
 js::ecmaHypot(double x, double y)
 {
-    AutoUnsafeCallWithABI unsafe;
+    AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
     return fdlibm::hypot(x, y);
 }
 
 static inline
 void
 hypot_step(double& scale, double& sumsq, double x)
 {
     double xabs = mozilla::Abs(x);
@@ -1118,17 +1118,17 @@ js::math_trunc(JSContext* cx, unsigned a
     }
 
     return math_trunc_handle(cx, args[0], args.rval());
 }
 
 double
 js::math_sign_impl(double x)
 {
-    AutoUnsafeCallWithABI unsafe;
+    AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
 
     if (mozilla::IsNaN(x)) {
         return GenericNaN();
     }
 
     return x == 0 ? x : x < 0 ? -1 : 1;
 }