Bug 1509441: Make sure non-Cranelift builds still work; rs=lth
authorBenjamin Bouvier <benj@benj.me>
Thu, 24 Jan 2019 13:32:44 +0100
changeset 515301 7df604faea71828fb893e6b5c8f090a35f57d261
parent 515300 cb20dcd8ea7e8e7a20392cfb7bf3759c26cfc240
child 515302 868210b65236bd04652cc27f58da352b5dda7533
child 515310 2c5eb9d8b8e2680e7ff3d8fe2714bfd78ef0c7d0
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1509441
milestone66.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 1509441: Make sure non-Cranelift builds still work; rs=lth
js/src/wasm/WasmCraneliftCompile.h
js/src/wasm/WasmJS.cpp
--- a/js/src/wasm/WasmCraneliftCompile.h
+++ b/js/src/wasm/WasmCraneliftCompile.h
@@ -21,17 +21,21 @@
 
 #include "mozilla/Attributes.h"
 
 #include "wasm/WasmGenerator.h"
 
 namespace js {
 namespace wasm {
 
+#ifdef ENABLE_WASM_CRANELIFT
 MOZ_MUST_USE bool CraneliftCanCompile();
+#else
+MOZ_MUST_USE inline bool CraneliftCanCompile() { return false; }
+#endif
 
 // Generates code with Cranelift.
 MOZ_MUST_USE bool CraneliftCompileFunctions(
     const ModuleEnvironment& env, LifoAlloc& lifo,
     const FuncCompileInputVector& inputs, CompiledCode* code,
     ExclusiveDeferredValidationState& dvs, UniqueChars* error);
 
 }  // namespace wasm
--- a/js/src/wasm/WasmJS.cpp
+++ b/js/src/wasm/WasmJS.cpp
@@ -102,18 +102,21 @@ bool wasm::HasCompilerSupport(JSContext*
     return false;
   }
 #endif
 
   return BaselineCanCompile() || IonCanCompile() || CraneliftCanCompile();
 }
 
 bool wasm::HasOptimizedCompilerTier(JSContext* cx) {
-  return (cx->options().wasmIon() && IonCanCompile()) ||
-         (cx->options().wasmCranelift() && CraneliftCanCompile());
+  return (cx->options().wasmIon() && IonCanCompile())
+#ifdef ENABLE_WASM_CRANELIFT
+         || (cx->options().wasmCranelift() && CraneliftCanCompile())
+#endif
+  ;
 }
 
 // Return whether wasm compilation is allowed by prefs.  This check
 // only makes sense if HasCompilerSupport() is true.
 static bool HasAvailableCompilerTier(JSContext* cx) {
   return (cx->options().wasmBaseline() && BaselineCanCompile()) ||
          HasOptimizedCompilerTier(cx);
 }