summaryrefslogtreecommitdiffstats
path: root/js/moz.configure
diff options
context:
space:
mode:
Diffstat (limited to 'js/moz.configure')
-rw-r--r--js/moz.configure103
1 files changed, 103 insertions, 0 deletions
diff --git a/js/moz.configure b/js/moz.configure
index 675736a797..0b098e7ab7 100644
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -750,6 +750,80 @@ def wasm_gc(value):
set_config("ENABLE_WASM_GC", wasm_gc)
set_define("ENABLE_WASM_GC", wasm_gc)
+# Support for JS PI spec.
+# ===========================
+
+
+@depends(
+ milestone.is_nightly,
+ "--enable-jit",
+ "--enable-simulator",
+ "--enable-wasm-gc",
+ "--enable-wasm-tail-calls",
+ target,
+)
+def default_wasm_jspi(
+ is_nightly,
+ jit_enabled,
+ simulator,
+ gc,
+ tail_calls,
+ target,
+):
+ if not jit_enabled or simulator:
+ return
+
+ if not gc or not tail_calls:
+ return
+
+ if not is_nightly:
+ return
+
+ if target.cpu in ("x86_64", "aarch64"):
+ return True
+
+
+option(
+ "--enable-wasm-jspi",
+ default=default_wasm_jspi,
+ help="{Enable|Disable} WebAssembly JS PI",
+)
+
+
+@depends(
+ "--enable-wasm-jspi",
+ "--enable-jit",
+ "--enable-simulator",
+ "--enable-wasm-gc",
+ "--enable-wasm-tail-calls",
+ "--wasm-no-experimental",
+ target,
+)
+def wasm_jspi(value, jit_enabled, simulator, gc, tail_calls, no_experimental, target):
+ if no_experimental or not value:
+ return
+
+ if not jit_enabled:
+ die("--enable-wasm-jspi requires --enable-jit")
+
+ if not gc:
+ die("--enable-wasm-jspi requires --enable-wasm-gc")
+
+ if not tail_calls:
+ die("--enable-wasm-jspi requires --enable-wasm-tail-calls")
+
+ if simulator:
+ die("--enable-wasm-jspi is not supported for simulators")
+
+ if target.cpu in ("x86_64", "aarch64"):
+ return True
+
+ die("--enable-wasm-jspi only possible when targeting the x86_64/arm64 jits")
+
+
+set_config("ENABLE_WASM_JSPI", wasm_jspi)
+set_define("ENABLE_WASM_JSPI", wasm_jspi)
+
# Support for WebAssembly JS String Builtins
# ==========================================
@@ -1076,6 +1150,35 @@ def wasm_multi_memory(value):
set_config("ENABLE_WASM_MULTI_MEMORY", wasm_multi_memory)
set_define("ENABLE_WASM_MULTI_MEMORY", wasm_multi_memory)
+
+# Support for WebAssembly Branch-hinting.
+# ===========================
+
+
+@depends(milestone.is_nightly)
+def default_wasm_branch_hinting(is_nightly):
+ if is_nightly:
+ return True
+
+
+option(
+ "--enable-wasm-branch-hinting",
+ default=default_wasm_branch_hinting,
+ help="{Enable|Disable} WebAssembly Branch hints",
+)
+
+
+@depends("--enable-wasm-branch-hinting", "--wasm-no-experimental")
+def wasm_branch_hinting(value, no_experimental):
+ if no_experimental or not value:
+ return
+
+ return True
+
+
+set_config("ENABLE_WASM_BRANCH_HINTING", wasm_branch_hinting)
+set_define("ENABLE_WASM_BRANCH_HINTING", wasm_branch_hinting)
+
# Options for generating the shell as a script
# ============================================
option("--with-qemu-exe", nargs=1, help="Use path as an arm emulator on host platforms")