Bug 1546293 - Improve Wasm gating for Ion. r=jseward
authorLars T Hansen <lhansen@mozilla.com>
Tue, 23 Apr 2019 10:02:53 +0200
changeset 529987 55de487e32e6c6b01f1e37ee96f23a63e5c8b638
parent 529986 968d4ed2e984a65bfb8bd60a9820c4aa45624dd5
child 529988 da523e237c3d922401d8d3e53fdabe14621d7eac
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjseward
bugs1546293
milestone68.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 1546293 - Improve Wasm gating for Ion. r=jseward Gating that explicitly lists the architectures that are supported is more resilient than one that lists architectures that are not. Differential Revision: https://phabricator.services.mozilla.com/D28447
js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h
js/src/wasm/WasmIonCompile.cpp
--- a/js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h
+++ b/js/src/jit/shared/AtomicOperations-feeling-lucky-gcc.h
@@ -39,23 +39,19 @@
 
 #if !(defined(__clang__) || defined(__GNUC__))
 #  error "This file only for gcc/Clang"
 #endif
 
 // 64-bit atomics are not required by the JS spec, and you can compile
 // SpiderMonkey without them.
 //
-// 64-bit lock-free atomics are however required for WebAssembly, and
-// WebAssembly will be disabled if you do not define both HAS_64BIT_ATOMICS and
-// HAS_64BIT_LOCKFREE.
-//
-// If you are only able to provide 64-bit non-lock-free atomics and you really
-// want WebAssembly support you can always just lie about the lock-freedom.
-// After all, you're already feeling lucky.
+// 64-bit lock-free atomics are required for WebAssembly, but gating in the
+// WebAssembly subsystem ensures that no WebAssembly-supporting platforms need
+// code in this file.
 
 #if defined(JS_SIMULATOR_ARM64) || defined(JS_SIMULATOR_ARM)
 // On some x86 (32-bit) systems this will not work because the compiler does not
 // open-code 64-bit atomics.  If so, try linking with -latomic.  If that doesn't
 // work, you're mostly on your own.
 #  define HAS_64BIT_ATOMICS
 #  define HAS_64BIT_LOCKFREE
 #endif
--- a/js/src/wasm/WasmIonCompile.cpp
+++ b/js/src/wasm/WasmIonCompile.cpp
@@ -4267,14 +4267,16 @@ bool wasm::IonCompileFunctions(const Mod
   if (masm.oom()) {
     return false;
   }
 
   return code->swap(masm);
 }
 
 bool js::wasm::IonCanCompile() {
-#if !defined(JS_CODEGEN_NONE) && !defined(JS_CODEGEN_ARM64)
+#if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_X86) ||    \
+    defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || \
+    defined(JS_CODEGEN_MIPS64)
   return true;
 #else
   return false;
 #endif
 }