Bug 1499471: Mark unsafe API functions to allow calling from recovery code r=tcampbell
authorIain Ireland <iireland@mozilla.com>
Tue, 16 Oct 2018 20:55:41 +0000
changeset 499982 d4fe026dee75521ac39478591cb84d782eb0b189
parent 499981 425bec190a04d3de38be9ded779d25b57c35849e
child 499983 bb2acd046eae1fbedfe11348dc3f31530a645fd8
child 500027 778427bb6353f85c1656f4ebcd2041560cd70c16
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1499471
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 1499471: Mark unsafe API functions to allow calling from recovery code r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D8899
js/src/builtin/Boolean-inl.h
js/src/jslibmath.h
js/src/jsmath.cpp
--- a/js/src/builtin/Boolean-inl.h
+++ b/js/src/builtin/Boolean-inl.h
@@ -15,16 +15,16 @@
 
 namespace js {
 
 inline bool
 EmulatesUndefined(JSObject* obj)
 {
     // This may be called off the main thread. It's OK not to expose the object
     // here as it doesn't escape.
-    AutoUnsafeCallWithABI unsafe;
+    AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
     JSObject* actual = MOZ_LIKELY(!obj->is<WrapperObject>()) ? obj : UncheckedUnwrapWithoutExpose(obj);
     return actual->getClass()->emulatesUndefined();
 }
 
 } /* namespace js */
 
 #endif /* builtin_Boolean_inl_h */
--- a/js/src/jslibmath.h
+++ b/js/src/jslibmath.h
@@ -14,34 +14,34 @@
 #include "js/Value.h"
 #include "vm/JSContext.h"
 
 namespace js {
 
 inline double
 NumberDiv(double a, double b)
 {
-    AutoUnsafeCallWithABI unsafe;
+    AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
     if (b == 0) {
         if (a == 0 || mozilla::IsNaN(a)) {
             return JS::GenericNaN();
         }
         if (mozilla::IsNegative(a) != mozilla::IsNegative(b)) {
             return mozilla::NegativeInfinity<double>();
         }
         return mozilla::PositiveInfinity<double>();
     }
 
     return a / b;
 }
 
 inline double
 NumberMod(double a, double b)
 {
-    AutoUnsafeCallWithABI unsafe;
+    AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
     if (b == 0) {
         return JS::GenericNaN();
     }
     return fmod(a, b);
 }
 
 } // namespace js
 
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -538,17 +538,17 @@ js::minmax_impl(JSContext* cx, bool max,
     }
 
     return true;
 }
 
 double
 js::powi(double x, int32_t y)
 {
-    AutoUnsafeCallWithABI unsafe;
+    AutoUnsafeCallWithABI unsafe(UnsafeABIStrictness::AllowPendingExceptions);
     uint32_t n = Abs(y);
     double m = x;
     double p = 1;
     while (true) {
         if ((n & 1) != 0) p *= m;
         n >>= 1;
         if (n == 0) {
             if (y < 0) {