Bug 1717914 - wasm: Add feature flags for Memory64. r=lth

Differential Revision: https://phabricator.services.mozilla.com/D118644
This commit is contained in:
Ryan Hunt 2021-07-16 20:58:09 +00:00
parent f601378f0d
commit f095d458ea
3 changed files with 39 additions and 1 deletions

View File

@ -872,6 +872,24 @@ def wasm_relaxed_simd(value, wasm_simd):
set_config("ENABLE_WASM_RELAXED_SIMD", wasm_relaxed_simd)
set_define("ENABLE_WASM_RELAXED_SIMD", wasm_relaxed_simd)
# Support for WebAssembly Memory64.
# ===========================
option(
"--enable-wasm-memory64",
default=False,
help="{Enable|Disable} WebAssembly Memory64",
)
@depends("--enable-wasm-memory64")
def wasm_memory64(value):
if value:
return True
set_config("ENABLE_WASM_MEMORY64", wasm_memory64)
set_define("ENABLE_WASM_MEMORY64", wasm_memory64)
# Options for generating the shell as a script
# ============================================

View File

@ -77,6 +77,11 @@
#else
# define WASM_GC_ENABLED 0
#endif
#ifdef ENABLE_WASM_MEMORY64
# define WASM_MEMORY64_ENABLED 1
#else
# define WASM_MEMORY64_ENABLED 0
#endif
// clang-format off
#define JS_FOR_WASM_FEATURES(DEFAULT, EXPERIMENTAL) \
@ -125,7 +130,15 @@
/* flag predicate */ !IsFuzzingCranelift(cx) && \
js::jit::JitSupportsWasmSimd(), \
/* shell flag */ "relaxed-simd", \
/* preference name */ "relaxed_simd")
/* preference name */ "relaxed_simd") \
EXPERIMENTAL(/* capitalized name */ Memory64, \
/* lower case name */ memory64, \
/* compile predicate */ WASM_MEMORY64_ENABLED, \
/* compiler predicate */ BaselineAvailable(cx), \
/* flag predicate */ !IsFuzzingIon(cx) && \
!IsFuzzingCranelift(cx), \
/* shell flag */ "memory64", \
/* preference name */ "memory64")
// clang-format on

View File

@ -6016,6 +6016,13 @@
mirror: always
#endif
#if defined(ENABLE_WASM_MEMORY64)
- name: javascript.options.wasm_memory64
type: bool
value: true
mirror: always
#endif // defined(ENABLE_WASM_MEMORY64)
# Support for ArrayBuffers larger than 2 GB on 64-bit systems
- name: javascript.options.large_arraybuffers
type: bool