Bug 1523015 - Summary: Enable Ion on ARM64, but disable in-browser by pref. r=nbp
authorSean Stangl <sean.stangl@gmail.com>
Tue, 12 Feb 2019 22:50:27 +0000
changeset 458817 2b3012fa3cbf
parent 458816 469060293380
child 458818 de25d2f1abef
push id35548
push useropoprus@mozilla.com
push dateWed, 13 Feb 2019 09:48:26 +0000
treeherdermozilla-central@93e37c529818 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1523015
milestone67.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 1523015 - Summary: Enable Ion on ARM64, but disable in-browser by pref. r=nbp Differential Revision: https://phabricator.services.mozilla.com/D19448
js/public/ContextOptions.h
js/src/jit-test/lib/jitopts.js
js/src/jit-test/tests/ion/bug1165905.js
js/src/jit/Ion.h
js/src/shell/js.cpp
modules/libpref/init/all.js
--- a/js/public/ContextOptions.h
+++ b/js/public/ContextOptions.h
@@ -14,19 +14,25 @@
 struct JSContext;
 
 namespace JS {
 
 class JS_PUBLIC_API ContextOptions {
  public:
   ContextOptions()
       : baseline_(true),
+#ifdef JS_CODEGEN_ARM64
+        ion_(false),
+        asmJS_(false),
+        wasm_(false),
+#else
         ion_(true),
         asmJS_(true),
         wasm_(true),
+#endif
         wasmVerbose_(false),
         wasmBaseline_(true),
         wasmIon_(true),
 #ifdef ENABLE_WASM_CRANELIFT
         wasmCranelift_(false),
 #endif
 #ifdef ENABLE_WASM_REFTYPES
         wasmGc_(false),
--- a/js/src/jit-test/lib/jitopts.js
+++ b/js/src/jit-test/lib/jitopts.js
@@ -4,23 +4,16 @@
 // different set of JIT toggles are set, since TBPL runs each jit-test
 // multiple times with a variety of flags.
 function jitTogglesMatch(opts) {
   var currentOpts = getJitCompilerOptions();
   for (var k in opts) {
     if (k.indexOf(".enable") > 0 && opts[k] != currentOpts[k])
       return false;
   }
-
-  // ARM64 does not yet have an Ion code generator, so return false if
-  // ion.enable is requested.
-  var conf = getBuildConfiguration();
-  if (conf['arm64'] && opts['ion.enable'])
-    return false;
-
   return true;
 }
 
 // Run fn under a particular set of JIT options.
 function withJitOptions(opts, fn) {
   var oldOpts = getJitCompilerOptions();
   for (var k in opts)
     setJitCompilerOption(k, opts[k]);
--- a/js/src/jit-test/tests/ion/bug1165905.js
+++ b/js/src/jit-test/tests/ion/bug1165905.js
@@ -1,6 +1,7 @@
+// |jit-test| skip-if: !this.getJitCompilerOptions() || !this.getJitCompilerOptions()['ion.enable']
 load(libdir + "asserts.js");
 var oldOpts = getJitCompilerOptions();
 for (var k in oldOpts)
     setJitCompilerOption(k, oldOpts[k]);
 var newOpts = getJitCompilerOptions();
 assertDeepEq(oldOpts, newOpts);
--- a/js/src/jit/Ion.h
+++ b/js/src/jit/Ion.h
@@ -155,18 +155,17 @@ void AttachFinishedCompilations(JSContex
 void FinishOffThreadBuilder(JSRuntime* runtime, IonBuilder* builder,
                             const AutoLockHelperThreadState& lock);
 void FreeIonBuilder(IonBuilder* builder);
 
 void LinkIonScript(JSContext* cx, HandleScript calleescript);
 uint8_t* LazyLinkTopActivation(JSContext* cx, LazyLinkExitFrameLayout* frame);
 
 static inline bool IsIonEnabled(JSContext* cx) {
-  // The ARM64 Ion engine is not yet implemented.
-#if defined(JS_CODEGEN_NONE) || defined(JS_CODEGEN_ARM64)
+#if defined(JS_CODEGEN_NONE)
   return false;
 #else
   return cx->options().ion() && cx->options().baseline() &&
          cx->runtime()->jitSupportsFloatingPoint;
 #endif
 }
 
 inline bool IsIonInlinableGetterOrSetterPC(jsbytecode* pc) {
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -9838,24 +9838,35 @@ static MOZ_MUST_USE bool ProcessArgs(JSC
     }
   }
 
   return true;
 }
 
 static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
   enableBaseline = !op.getBoolOption("no-baseline");
+#ifdef JS_CODEGEN_ARM64
+  // TODO: Enable Ion by default.
+  enableIon = false;
+  enableAsmJS = false;
+#else
   enableIon = !op.getBoolOption("no-ion");
   enableAsmJS = !op.getBoolOption("no-asmjs");
+#endif
   enableNativeRegExp = !op.getBoolOption("no-native-regexp");
 
   // Default values for wasm.
   enableWasm = true;
   enableWasmBaseline = true;
+#ifdef JS_CODEGEN_ARM64
+  // TODO: Enable WasmIon by default.
+  enableWasmIon = false;
+#else
   enableWasmIon = true;
+#endif
   if (const char* str = op.getStringOption("wasm-compiler")) {
     if (strcmp(str, "none") == 0) {
       enableWasm = false;
     } else if (strcmp(str, "baseline") == 0) {
       // Baseline is enabled by default.
       enableWasmIon = false;
     } else if (strcmp(str, "ion") == 0) {
       // Ion is enabled by default.
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1457,17 +1457,21 @@ pref("javascript.enabled",              
 pref("javascript.options.strict",           false);
 #ifdef DEBUG
 pref("javascript.options.strict.debug",     false);
 #endif
 pref("javascript.options.unboxed_objects",  false);
 pref("javascript.options.baselinejit",      true);
 //Duplicated in JitOptions - ensure both match.
 pref("javascript.options.baselinejit.threshold", 10);
+#ifdef _ARM64_
+pref("javascript.options.ion",              false);
+#else
 pref("javascript.options.ion",              true);
+#endif
 //Duplicated in JitOptions - ensure both match.
 pref("javascript.options.ion.threshold",    1000);
 //Duplicated in JitOptions - ensure both match.
 pref("javascript.options.ion.frequent_bailout_threshold", 10);
 pref("javascript.options.asmjs",            true);
 pref("javascript.options.wasm",             true);
 pref("javascript.options.wasm_verbose",     false);
 pref("javascript.options.wasm_ionjit",      true);