Bug 1879179 - wasm: Use JSPrefs for WasmFeatures.h. r=bvisness

Replace the part of WasmFeatures.h which would manually
read prefs through touching a bunch of Gecko stuff and
instead just use JSPrefs for that. Also use JSPrefs for
the shell instead of rolling our own shell flags. This
commit removes the 'stage' distinction because that only
changed how shell flags worked.

Differential Revision: https://phabricator.services.mozilla.com/D201869
This commit is contained in:
Ryan Hunt 2024-02-27 16:56:02 +00:00
Родитель ec624a75b1
Коммит ad5665f325
64 изменённых файлов: 183 добавлений и 251 удалений

Просмотреть файл

@ -27,9 +27,6 @@ class JS_PUBLIC_API ContextOptions {
wasmVerbose_(false),
wasmBaseline_(true),
wasmIon_(true),
#define WASM_FEATURE(NAME, LOWER_NAME, STAGE, ...) wasm##NAME##_(STAGE == WasmFeatureStage::Default),
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE
testWasmAwaitTier2_(false),
disableIon_(false),
disableEvalSecurityChecks_(false),
@ -98,15 +95,6 @@ class JS_PUBLIC_API ContextOptions {
return *this;
}
#define WASM_FEATURE(NAME, ...) \
bool wasm##NAME() const { return wasm##NAME##_; } \
ContextOptions& setWasm##NAME(bool flag) { \
wasm##NAME##_ = flag; \
return *this; \
}
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE
bool throwOnAsmJSValidationFailure() const {
return compileOptions_.throwOnAsmJSValidationFailure();
}
@ -224,9 +212,6 @@ class JS_PUBLIC_API ContextOptions {
bool wasmVerbose_ : 1;
bool wasmBaseline_ : 1;
bool wasmIon_ : 1;
#define WASM_FEATURE(NAME, ...) bool wasm##NAME##_ : 1;
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE
bool testWasmAwaitTier2_ : 1;
// JIT options.

Просмотреть файл

@ -13,22 +13,6 @@
// generate most of the feature gating code in a centralized manner. See
// 'Adding a feature' below for the exact steps needed to add a new feature.
//
// Each feature is either `DEFAULT`, `TENTATIVE`, or `EXPERIMENTAL`:
//
// Default features are enabled by default in ContextOptions and in the
// JS-shell, and are given a `--no-wasm-FEATURE` shell flag to disable. The
// `--wasm-FEATURE` flag is rejected.
//
// Tentative features are like Default features, but the `--wasm-FEATURE` flag
// is silently ignored.
//
// Experimental features are disabled by default in ContextOptions and in the
// JS-shell, and are given a `--wasm-FEATURE` shell flag to enable. The
// `--no-wasm-FEATURE` flag is silently ignored.
//
// The browser pref is `javascript.options.wasm-FEATURE` for default, tentative,
// and experimental features alike.
//
// # Adding a feature
//
// 1. Add a configure switch for the feature in js/moz.configure
@ -44,12 +28,10 @@
// e. flag predicate: Expression used to predicate enablement of feature
// flag. Useful for disabling a feature when dependent feature is not
// enabled or if we are fuzzing.
// f. shell flag: The stem of the JS-shell flag. Will be expanded to
// --no-wasm-FEATURE or --wasm-FEATURE as explained above.
// g. preference name: The stem of the browser preference. Will be expanded
// f. preference name: The stem of the browser preference. Will be expanded
// to `javascript.options.wasm-FEATURE`.
// 4. Add the preference to module/libpref/init/StaticPrefList.yaml
// a. Use conditionally compiled flag
// a. Set `set_spidermonkey_pref: startup`
// b. Set value to 'true' for default features, @IS_NIGHTLY_BUILD@ for
// tentative features, and 'false' for experimental features.
// 5. [fuzzing] Add the feature to gluesmith/src/lib.rs, if wasm-smith has
@ -106,168 +88,125 @@
# define WASM_JS_STRING_BUILTINS_ENABLED 0
#endif
enum class WasmFeatureStage {
Experimental = 0,
Tentative,
Default,
};
// clang-format off
#define JS_FOR_WASM_FEATURES(FEATURE) \
FEATURE( \
/* capitalized name */ ExtendedConst, \
/* lower case name */ extendedConst, \
/* stage */ WasmFeatureStage::Tentative, \
/* compile predicate */ WASM_EXTENDED_CONST_ENABLED, \
/* compiler predicate */ true, \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ true, \
/* shell flag */ "extended-const", \
/* preference name */ "extended_const") \
/* preference name */ extended_const) \
FEATURE( \
/* capitalized name */ Exceptions, \
/* lower case name */ exceptions, \
/* stage */ WasmFeatureStage::Default, \
/* compile predicate */ true, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ WasmExnRefFlag(cx), \
/* flag fuzz enable */ true, \
/* shell flag */ "exceptions", \
/* preference name */ "exceptions") \
/* preference name */ exceptions) \
FEATURE( \
/* capitalized name */ ExnRef, \
/* lower case name */ exnref, \
/* stage */ WasmFeatureStage::Experimental, \
/* compile predicate */ true, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ true, \
/* shell flag */ "exnref", \
/* preference name */ "exnref ") \
/* preference name */ exnref) \
FEATURE( \
/* capitalized name */ FunctionReferences, \
/* lower case name */ functionReferences, \
/* stage */ WasmFeatureStage::Tentative, \
/* compile predicate */ WASM_FUNCTION_REFERENCES_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ WasmGcFlag(cx), \
/* flag fuzz enable */ false, \
/* shell flag */ "function-references", \
/* preference name */ "function_references") \
/* preference name */ function_references) \
FEATURE( \
/* capitalized name */ Gc, \
/* lower case name */ gc, \
/* stage */ WasmFeatureStage::Tentative, \
/* compile predicate */ WASM_GC_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ false, \
/* shell flag */ "gc", \
/* preference name */ "gc") \
/* preference name */ gc) \
FEATURE( \
/* capitalized name */ JSStringBuiltins, \
/* lower case name */ jsStringBuiltins, \
/* stage */ WasmFeatureStage::Experimental, \
/* compile predicate */ WASM_JS_STRING_BUILTINS_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ true, \
/* shell flag */ "js-string-builtins", \
/* preference name */ "js_string_builtins") \
/* preference name */ js_string_builtins) \
FEATURE( \
/* capitalized name */ RelaxedSimd, \
/* lower case name */ v128Relaxed, \
/* stage */ WasmFeatureStage::Tentative, \
/* compile predicate */ WASM_RELAXED_SIMD_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ js::jit::JitSupportsWasmSimd(), \
/* flag force enable */ false, \
/* flag fuzz enable */ true, \
/* shell flag */ "relaxed-simd", \
/* preference name */ "relaxed_simd") \
/* preference name */ relaxed_simd) \
FEATURE( \
/* capitalized name */ Memory64, \
/* lower case name */ memory64, \
/* stage */ WasmFeatureStage::Tentative, \
/* compile predicate */ WASM_MEMORY64_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ true, \
/* shell flag */ "memory64", \
/* preference name */ "memory64") \
/* preference name */ memory64) \
FEATURE( \
/* capitalized name */ MemoryControl, \
/* lower case name */ memoryControl, \
/* stage */ WasmFeatureStage::Experimental, \
/* compile predicate */ WASM_MEMORY_CONTROL_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ false, \
/* shell flag */ "memory-control", \
/* preference name */ "memory_control") \
/* preference name */ memory_control) \
FEATURE( \
/* capitalized name */ MultiMemory, \
/* lower case name */ multiMemory, \
/* stage */ WasmFeatureStage::Experimental, \
/* compile predicate */ WASM_MULTI_MEMORY_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ false, \
/* shell flag */ "multi-memory", \
/* preference name */ "multi_memory") \
/* preference name */ multi_memory) \
FEATURE( \
/* capitalized name */ TailCalls, \
/* lower case name */ tailCalls, \
/* stage */ WasmFeatureStage::Tentative, \
/* compile predicate */ WASM_TAIL_CALLS_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ true, \
/* shell flag */ "tail-calls", \
/* preference name */ "tail_calls") \
/* preference name */ tail_calls) \
FEATURE( \
/* capitalized name */ MozIntGemm, \
/* lower case name */ mozIntGemm, \
/* stage */ WasmFeatureStage::Experimental, \
/* compile predicate */ WASM_MOZ_INTGEMM_ENABLED, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ IsSimdPrivilegedContext(cx), \
/* flag force enable */ false, \
/* flag fuzz enable */ false, \
/* shell flag */ "moz-intgemm", \
/* preference name */ "moz_intgemm") \
/* preference name */ moz_intgemm) \
FEATURE( \
/* capitalized name */ TestSerialization, \
/* lower case name */ testSerialization, \
/* stage */ WasmFeatureStage::Experimental, \
/* compile predicate */ 1, \
/* compiler predicate */ IonAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ false, \
/* shell flag */ "test-serialization", \
/* preference name */ "test-serialization") \
FEATURE( \
/* capitalized name */ TestMetadata, \
/* lower case name */ testMetadata, \
/* stage */ WasmFeatureStage::Experimental, \
/* compile predicate */ 1, \
/* compiler predicate */ AnyCompilerAvailable(cx), \
/* flag predicate */ true, \
/* flag force enable */ false, \
/* flag fuzz enable */ false, \
/* shell flag */ "test-metadata", \
/* preference name */ "test_metadata")
/* preference name */ test_serialization)
// clang-format on

Просмотреть файл

@ -2076,7 +2076,6 @@ static bool WasmReturnFlag(JSContext* cx, unsigned argc, Value* vp, Flag flag) {
return true;
}
#if defined(DEBUG)
static bool wasmMetadataAnalysis(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
@ -2085,10 +2084,6 @@ static bool wasmMetadataAnalysis(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
if (!cx->options().wasmTestMetadata()) {
return false;
}
if (args[0].toObject().is<WasmModuleObject>()) {
HashMap<const char*, uint32_t, mozilla::CStringHasher, SystemAllocPolicy>
hashmap = args[0]
@ -2130,7 +2125,6 @@ static bool wasmMetadataAnalysis(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
#endif
static bool WasmHasTier2CompilationCompleted(JSContext* cx, unsigned argc,
Value* vp) {
@ -9959,11 +9953,9 @@ JS_FOR_WASM_FEATURES(WASM_FEATURE)
" element's edge is the node of the i+1'th array element; the destination of\n"
" the last array element is implicitly |target|.\n"),
#if defined(DEBUG)
JS_FN_HELP("wasmMetadataAnalysis", wasmMetadataAnalysis, 1, 0,
"wasmMetadataAnalysis(wasmObject)",
" Prints an analysis of the size of metadata on this wasm object.\n"),
#endif
#if defined(DEBUG) || defined(JS_JITSPEW)
JS_FN_HELP("dumpObject", DumpObject, 1, 0,

Просмотреть файл

@ -9,6 +9,7 @@
#include "fuzz-tests/tests.h"
#include "js/CallAndConstruct.h"
#include "js/Prefs.h"
#include "js/PropertyAndElement.h" // JS_Enumerate, JS_GetProperty, JS_GetPropertyById, JS_HasProperty, JS_SetProperty
#include "vm/GlobalObject.h"
#include "vm/Interpreter.h"
@ -40,13 +41,11 @@ static int testWasmInit(int* argc, char*** argv) {
MOZ_CRASH("Wasm is not supported");
}
JS::ContextOptionsRef(gCx)
#define WASM_FEATURE(NAME, LOWER_NAME, STAGE, COMPILE_PRED, COMPILER_PRED, \
FLAG_PRED, FLAG_FORCE_ON, FLAG_FUZZ_ON, SHELL, PREF) \
.setWasm##NAME(FLAG_FUZZ_ON)
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#define WASM_FEATURE(NAME, LOWER_NAME, COMPILE_PRED, COMPILER_PRED, FLAG_PRED, \
FLAG_FORCE_ON, FLAG_FUZZ_ON, PREF) \
JS::Prefs::setAtStartup_wasm_##PREF(FLAG_FUZZ_ON);
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE
;
if (!GlobalObject::getOrCreateConstructor(gCx, JSProto_WebAssembly)) {
MOZ_CRASH("Failed to initialize wasm engine");

Просмотреть файл

@ -1,6 +1,6 @@
# Standard 'directives.txt' prologues for jit-tests
harness_directive = "|jit-test| skip-if: true"
directive = "|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js"
directive = "|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js"
# Failing tests across all testsuites
excluded_tests = [
@ -43,7 +43,7 @@ url = "https://github.com/WebAssembly/exception-handling"
branch = "main"
parent = "spec"
# Skip in jit-test when it's not enabled
directive = "; --wasm-exceptions; --wasm-exnref; skip-if: !wasmExceptionsEnabled()"
directive = "; --setpref=wasm_exceptions=true; --setpref=wasm_exnref=true; skip-if: !wasmExceptionsEnabled()"
excluded_tests = [
# harness doesn't support exnref, because JS-API globals can't use it
"ref_null.wast.js"
@ -53,7 +53,7 @@ excluded_tests = [
name = "memory64"
url = "https://github.com/mozilla-spidermonkey/memory64"
branch = "test-cases"
directive = "; skip-if: !wasmMemory64Enabled()"
directive = "; --setpref=wasm_memory64=true; skip-if: !wasmMemory64Enabled()"
excluded_tests = []
[[repos]]
@ -61,7 +61,7 @@ name = "function-references"
url = "https://github.com/WebAssembly/function-references"
branch = "main"
parent = "spec"
directive = "; --wasm-function-references; skip-if: !wasmFunctionReferencesEnabled()"
directive = "; --setpref=wasm_function_references=true; skip-if: !wasmFunctionReferencesEnabled()"
excluded_tests = [
# duplicate tail calls tests
"return_call.wast",
@ -87,7 +87,7 @@ name = "relaxed-simd"
url = "https://github.com/WebAssembly/relaxed-simd"
branch = "main"
parent = "spec"
directive = "; --wasm-relaxed-simd; skip-if: !wasmRelaxedSimdEnabled()"
directive = "; --setpref=wasm_relaxed_simd=true; skip-if: !wasmRelaxedSimdEnabled()"
excluded_tests = []
[[repos]]
@ -95,7 +95,7 @@ name = "extended-const"
url = "https://github.com/WebAssembly/extended-const"
branch = "main"
parent = "spec"
directive = "; --wasm-extended-const; --no-wasm-gc; skip-if: !wasmExtendedConstEnabled()"
directive = "; --setpref=wasm_extended_const=true; --setpref=wasm_gc=false; skip-if: !wasmExtendedConstEnabled()"
excluded_tests = []
[[repos]]
@ -103,7 +103,7 @@ name = "tail-call"
url = "https://github.com/WebAssembly/tail-call"
branch = "main"
parent = "spec"
directive = "; --wasm-tail-calls; skip-if: !wasmTailCallsEnabled()"
directive = "; --setpref=wasm_tail_calls=true; skip-if: !wasmTailCallsEnabled()"
excluded_tests = []
[[repos]]
@ -111,7 +111,7 @@ name = "multi-memory"
url = "https://github.com/WebAssembly/multi-memory"
branch = "main"
parent = "spec"
directive = "; --wasm-multi-memory; skip-if: !wasmMultiMemoryEnabled()"
directive = "; --setpref=wasm_multi_memory=true; skip-if: !wasmMultiMemoryEnabled()"
excluded_tests = [
# Empty test fails parsing
"memory_copy1.wast",
@ -122,7 +122,7 @@ name = "gc"
url = "https://github.com/WebAssembly/gc"
branch = "main"
parent = "function-references"
directive = "; --wasm-gc; skip-if: !wasmGcEnabled()"
directive = "; --setpref=wasm_gc=true; skip-if: !wasmGcEnabled()"
excluded_tests = [
# tail call tests that snuck in
"return_call.wast",

Просмотреть файл

@ -720,7 +720,7 @@ index 3ea51a8cb0ff3..71739f4a1c8e4 100644
--- a/js/src/jit-test/tests/wasm/spec/function-references/return_call_ref.wast.js
+++ b/js/src/jit-test/tests/wasm/spec/function-references/return_call_ref.wast.js
@@ -1,3 +1,4 @@
+// |jit-test| --wasm-tail-calls; skip-if: !wasmTailCallsEnabled()
+// |jit-test| --setpref=wasm_tail_calls=true; skip-if: !wasmTailCallsEnabled()
/* Copyright 2021 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -728,7 +728,7 @@ diff --git a/js/src/jit-test/tests/wasm/spec/spec/global.wast.js b/js/src/jit-te
--- a/js/src/jit-test/tests/wasm/spec/spec/global.wast.js
+++ b/js/src/jit-test/tests/wasm/spec/spec/global.wast.js
@@ -1,3 +1,4 @@
+// |jit-test| --no-wasm-gc
+// |jit-test| --setpref=wasm_gc=false
/* Copyright 2021 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

Просмотреть файл

@ -160,6 +160,7 @@ const MozPrefix = 0xff;
const definedOpcodes =
[0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
...(wasmExceptionsEnabled() ? [0x06, 0x07, 0x08, 0x09] : []),
...(wasmExnRefEnabled() ? [0x0a] : []),
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11,
...(wasmTailCallsEnabled() ? [0x12, 0x13] : []),
@ -168,6 +169,7 @@ const definedOpcodes =
wasmFunctionReferencesEnabled() ? [0x15] : []),
...(wasmExceptionsEnabled() ? [0x18, 0x19] : []),
0x1a, 0x1b, 0x1c,
...(wasmExnRefEnabled() ? [0x1f] : []),
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-function-references --wasm-gc; skip-if: !wasmDebuggingEnabled() || !wasmGcEnabled(); skip-if: true
// |jit-test| test-also=--wasm-compiler=optimizing; test-also=--setpref=wasm_gc=true; skip-if: !wasmDebuggingEnabled() || !wasmGcEnabled(); skip-if: true
// An extension of wasm-10.js, testing that wasm GC objects are inspectable in locals.
// As of bug 1825098, this test is disabled. (skip-if: true)

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-gc; skip-if: !wasmCachingEnabled() || !wasmGcEnabled()
// |jit-test| --setpref=wasm_gc=true; skip-if: !wasmCachingEnabled() || !wasmGcEnabled()
const code = wasmTextToBinary(`(module
(type $t (struct (field i32) (field anyref)))

Просмотреть файл

@ -1 +1 @@
|jit-test| --wasm-moz-intgemm; skip-if: (!getBuildConfiguration("x64") && !getBuildConfiguration("x86") && !getBuildConfiguration("arm64")) || getBuildConfiguration("simulator") || !wasmMozIntGemmEnabled()
|jit-test| --setpref=wasm_moz_intgemm=true; skip-if: (!getBuildConfiguration("x64") && !getBuildConfiguration("x86") && !getBuildConfiguration("arm64")) || getBuildConfiguration("simulator") || !wasmMozIntGemmEnabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| --wasm-gc; --wasm-js-string-builtins; test-also=--wasm-compiler=optimizing; include:wasm.js
|jit-test| --setpref=wasm_js_string_builtins=true; test-also=--wasm-compiler=optimizing; include:wasm.js

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); test-also=--wasm-test-serialization; test-also=--wasm-compiler=optimizing --no-avx; skip-variant-if: --wasm-compiler=optimizing --no-avx, !getBuildConfiguration("x86") && !getBuildConfiguration("x64") || getBuildConfiguration("simulator"); include:wasm.js
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); test-also=--setpref=wasm_test_serialization=true; test-also=--wasm-compiler=optimizing --no-avx; skip-variant-if: --wasm-compiler=optimizing --no-avx, !getBuildConfiguration("x86") && !getBuildConfiguration("x64") || getBuildConfiguration("simulator"); include:wasm.js

Просмотреть файл

@ -1 +1 @@
|jit-test| --wasm-exceptions; test-also=--wasm-exnref; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; include:wasm.js; skip-if: !wasmExceptionsEnabled()
|jit-test| test-also=--setpref=wasm_exnref=true; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; include:wasm.js; skip-if: !wasmExceptionsEnabled()

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| test-also=--wasm-function-references --wasm-gc --wasm-compiler=optimizing; test-also=--wasm-function-references --wasm-gc --wasm-compiler=baseline;
// |jit-test| test-also=--setpref=wasm_gc=true --wasm-compiler=optimizing; test-also=--setpref=wasm_gc=true --wasm-compiler=baseline;
wasmFailValidateText(`(module
(tag)

Просмотреть файл

@ -1 +1 @@
|jit-test| --wasm-exnref; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; include:wasm.js; skip-if: !wasmExnRefEnabled()
|jit-test| --setpref=wasm_exnref=true; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; include:wasm.js; skip-if: !wasmExnRefEnabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| --wasm-extended-const; test-also=--wasm-compiler=optimizing; test-also=--wasm-test-serialization; test-also=--wasm-compiler=baseline; test-also=--test-wasm-await-tier2; include:wasm.js
|jit-test| --setpref=wasm_extended_const=true; test-also=--wasm-compiler=optimizing; test-also=--setpref=wasm_test_serialization=true; test-also=--wasm-compiler=baseline; test-also=--test-wasm-await-tier2; include:wasm.js

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| test-also=--wasm-extended-const; test-also=--wasm-exceptions;
// |jit-test| test-also=--setpref=wasm_extended_const=true; test-also=--setpref=wasm_exceptions=true;
// Test that if a feature is 'experimental' then we must be in a nightly build,
// and if a feature is 'released' then it must be enabled on release and beta.

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing --wasm-function-references; test-also=--wasm-compiler=baseline --wasm-function-references; include:wasm.js
|jit-test| test-also=--setpref=wasm_function_references=true; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; include:wasm.js

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| skip-if: !wasmGcEnabled(); --wasm-test-serialization
// |jit-test| skip-if: !wasmGcEnabled(); --setpref=wasm_test_serialization=true
wasmEvalText(`(module
(type (sub (array (mut i32))))

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| skip-if: !wasmGcEnabled(); --wasm-test-serialization
// |jit-test| skip-if: !wasmGcEnabled(); --setpref=wasm_test_serialization=true
// Test that serialization doesn't create a forward reference to the third
// struct when serializing the reference to the first struct, which is

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| test-also=--wasm-test-serialization; skip-if: !wasmGcEnabled()
// |jit-test| test-also=--setpref=wasm_test_serialization=true; skip-if: !wasmGcEnabled()
let {run} = wasmEvalText(`(module
(rec (type $$t1 (func (result (ref null $$t1)))))

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| test-also=--wasm-test-serialization; skip-if: !wasmGcEnabled()
// |jit-test| test-also=-P wasm_test_serialization; skip-if: !wasmGcEnabled()
// Conditional branch instructions need to rewrite their stack types according
// to the destination label types. This loses information but is mandated by

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| test-also=--wasm-tail-calls; skip-if: !wasmGcEnabled()
// |jit-test| test-also=--setpref=wasm_tail_calls=true; skip-if: !wasmGcEnabled()
// Test that call_indirect will respect subtyping by defining a bunch of types
// and checking every combination of (expected, actual) type.

Просмотреть файл

@ -1 +1 @@
|jit-test| --wasm-gc; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; include:wasm.js
|jit-test| test-also=--setpref=wasm_gc=true; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; include:wasm.js

Просмотреть файл

@ -10,7 +10,7 @@
// actually testing something here.
//
// Some logging with printf confirms that refmod is baseline-compiled and
// nonrefmod is ion-compiled at present, with --wasm-gc enabled.
// nonrefmod is ion-compiled at present, with --setpref=wasm_gc=true enabled.
var refmod = new WebAssembly.Module(wasmTextToBinary(
`(module

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| test-also=--wasm-extended-const; test-also=--no-wasm-extended-const
// |jit-test| test-also=--setpref=wasm_extended_const=true; test-also=--setpref=wasm_extended_const=false
const { Instance, Module, LinkError } = WebAssembly;

Просмотреть файл

@ -1 +1 @@
|jit-test| include:wasm.js; test-also=--wasm-compiler=optimizing --wasm-memory-control; test-also=--wasm-compiler=baseline --wasm-memory-control; test-also=--wasm-compiler=optimizing --no-wasm-memory64 --wasm-memory-control; test-also=--wasm-compiler=baseline --no-wasm-memory64 --wasm-memory-control
|jit-test| include:wasm.js; test-also=--wasm-compiler=optimizing --setpref=wasm_memory_control=true; test-also=--wasm-compiler=baseline --setpref=wasm_memory_control=true; test-also=--wasm-compiler=optimizing --setpref=wasm_memory64=false --setpref=wasm_memory_control=true; test-also=--wasm-compiler=baseline --setpref=wasm_memory64=false --setpref=wasm_memory_control=true

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| skip-if: !wasmMemoryControlEnabled(); test-also=--wasm-memory64; test-also=--no-wasm-memory64
// |jit-test| skip-if: !wasmMemoryControlEnabled(); test-also=--setpref=wasm_memory64=true; test-also=--setpref=wasm_memory64=false
// This tests memory.discard and WebAssembly.Memory.discard() by placing data
// (the alphabet) halfway across a page boundary, then discarding the first

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; include:wasm.js; skip-if: !wasmMemory64Enabled()
|jit-test| test-also=--setpref=wasm_memory64=true; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; include:wasm.js; skip-if: !wasmMemory64Enabled()

Просмотреть файл

@ -1,2 +1,2 @@
|jit-test| --wasm-multi-memory; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; include:wasm.js; skip-if: !wasmMultiMemoryEnabled()
|jit-test| --setpref=wasm_multi_memory=true; test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; include:wasm.js; skip-if: !wasmMultiMemoryEnabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); include:wasm.js
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); include:wasm.js

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); test-also=--wasm-test-serialization; include:wasm.js
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); test-also=--setpref=wasm_test_serialization=true; include:wasm.js

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-gc; --wasm-function-references; skip-if: !wasmGcEnabled() || !wasmFunctionReferencesEnabled()
// |jit-test| --setpref=wasm_gc=true; --setpref=wasm_function_references=true; skip-if: !wasmGcEnabled() || !wasmFunctionReferencesEnabled()
function wasmEvalText(str, imports) {
let binary = wasmTextToBinary(str);
m = new WebAssembly.Module(binary);

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-gc; --wasm-function-references; skip-if: !wasmSimdEnabled() || !wasmGcEnabled() || !wasmFunctionReferencesEnabled()
// |jit-test| --setpref=wasm_gc=true; --setpref=wasm_function_references=true; skip-if: !wasmSimdEnabled() || !wasmGcEnabled() || !wasmFunctionReferencesEnabled()
var wasm_code = new Uint8Array([0,97,115,109,1,0,0,0,1,152,128,128,128,0,4,80,0,95,1,126,0,80,0,94,124,1,80,0,96,3,127,127,127,1,127,96,0,0,3,130,128,128,128,0,1,2,4,133,128,128,128,0,1,112,1,1,1,5,132,128,128,128,0,1,1,16,32,13,131,128,128,128,0,1,0,3,6,204,131,128,128,0,62,100,107,0,66,197,129,131,134,140,152,176,224,64,251,0,0,11,127,0,65,196,129,131,134,124,11,100,107,0,66,192,129,131,134,204,132,137,146,36,251,0,0,11,124,1,68,0,0,0,0,0,0,0,0,11,124,1,68,0,0,0,0,0,0,0,0,11,124,1,68,0,0,0,0,0,0,0,0,11,124,1,68,0,0,0,0,0,0,0,0,11,100,107,0,66,192,129,131,134,140,216,53,251,0,0,11,100,107,1,66,210,164,201,146,165,202,148,169,210,0,66,210,164,201,146,165,202,212,156,218,0,66,192,129,131,134,140,152,176,224,64,66,192,129,131,134,140,152,176,224,64,126,125,66,192,129,131,128,130,152,176,224,64,125,66,192,129,131,190,130,152,176,224,36,125,66,164,200,0,125,125,66,0,125,66,0,125,66,0,125,251,0,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,127,0,65,0,11,7,136,128,128,128,0,1,4,109,97,105,110,0,0,9,139,128,128,128,0,1,6,0,65,0,11,112,1,210,0,11,10,141,133,128,128,0,1,138,5,0,65,238,235,177,226,126,253,15,253,83,32,0,65,235,146,246,155,122,65,244,231,246,248,124,253,15,253,164,1,65,230,152,157,154,7,253,15,253,164,1,118,65,167,184,218,133,127,253,15,253,164,1,118,118,66,149,131,127,66,164,128,218,132,206,227,209,231,254,0,65,230,133,189,200,126,65,252,208,237,164,5,254,32,0,132,245,241,222,13,27,254,71,2,211,226,246,158,7,66,243,213,226,237,209,166,141,199,0,68,76,189,205,180,194,110,195,89,36,3,131,253,18,253,127,253,127,253,127,253,127,253,164,1,65,138,173,198,47,65,138,248,237,203,120,65,205,162,146,252,5,65,190,148,192,156,5,254,53,0,200,229,139,195,9,65,167,139,216,173,5,65,215,146,221,45,254,53,0,169,255,135,252,1,254,53,0,193,209,131,217,7,40,2,134,242,184,197,3,65,228,191,145,146,6,65,142,162,226,169,4,254,53,0,168,178,151,189,15,113,109,71,109,107,254,46,0,191,232,145,230,9,67,66,84,34,11,67,88,147,220,200,91,68,233,240,20,66,52,37,190,38,182,187,182,187,182,187,182,187,182,187,57,3,168,169,148,198,10,65,226,162,208,167,7,65,221,226,226,242,120,107,65,140,215,139,233,5,65,141,151,153,19,107,107,65,188,134,175,165,5,65,183,219,200,136,121,107,65,250,197,157,214,123,65,139,168,173,167,126,107,107,107,42,1,249,156,171,169,13,187,182,187,182,187,182,187,182,187,182,65,191,253,243,170,122,253,15,65,203,195,202,169,122,253,15,65,179,204,244,234,123,253,15,253,119,65,166,184,138,186,122,253,15,65,129,140,243,163,6,253,15,253,119,65,229,139,254,233,121,253,15,65,183,191,195,183,122,253,15,253,119,253,119,65,151,211,231,151,122,253,15,253,119,253,119,253,119,65,192,156,192,215,3,65,178,193,209,198,7,107,65,240,157,246,199,6,65,221,225,148,169,1,107,65,145,183,142,141,127,65,188,218,139,244,7,107,107,65,236,243,250,169,127,65,146,241,174,181,120,107,65,139,147,232,229,124,65,255,203,253,217,3,107,107,65,250,197,224,140,2,65,202,242,215,181,3,107,65,135,244,246,28,65,140,170,229,200,123,107,107,107,65,154,217,196,153,1,65,137,128,243,231,123,107,107,107,107,65,227,146,143,180,126,40,1,245,130,139,196,13,40,2,244,172,225,238,10,40,0,216,160,178,215,11,40,1,197,193,230,178,3,40,2,195,241,223,254,2,65,158,240,247,204,124,40,2,140,190,218,180,14,40,2,215,128,167,146,8,40,0,141,143,157,196,10,40,0,147,146,185,143,13,40,1,195,168,134,179,5,107,107,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,253,15,253,119,253,31,0,91,254,46,0,203,243,148,239,8,11]);
var wasm_module = new WebAssembly.Module(wasm_code);
var wasm_instance = new WebAssembly.Instance(wasm_module);

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-gc; skip-if: !wasmGcEnabled()
// |jit-test| --setpref=wasm_gc=true; skip-if: !wasmGcEnabled()
// Validates if imported globals are accounted for in init expressions.

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-gc; skip-if: !wasmGcEnabled()
// |jit-test| --setpref=wasm_gc=true; skip-if: !wasmGcEnabled()
// Tests if i31ref global value is normalized.
var ins = wasmEvalText(`(module

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-tail-calls; --wasm-gc; skip-if: !wasmGcEnabled() || !wasmTailCallsEnabled()
// |jit-test| --setpref=wasm_tail_calls=true; --setpref=wasm_gc=true; skip-if: !wasmGcEnabled() || !wasmTailCallsEnabled()
// Tests if instance registers were restored properly when call_ref is used
// with tail calls.

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=baseline; test-also=--wasm-compiler=optimizing; test-also=--wasm-test-serialization; test-also=--wasm-compiler=optimizing --no-avx; skip-variant-if: --wasm-compiler=optimizing --no-avx, !getBuildConfiguration("x86") && !getBuildConfiguration("x64") || getBuildConfiguration("simulator"); include:wasm.js
|jit-test| test-also=--wasm-compiler=baseline; test-also=--wasm-compiler=optimizing; test-also=--setpref=wasm_test_serialization=true; test-also=--wasm-compiler=optimizing --no-avx; skip-variant-if: --wasm-compiler=optimizing --no-avx, !getBuildConfiguration("x86") && !getBuildConfiguration("x64") || getBuildConfiguration("simulator"); include:wasm.js

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-relaxed-simd; skip-if: !wasmRelaxedSimdEnabled()
// |jit-test| --setpref=wasm_relaxed_simd=true; skip-if: !wasmRelaxedSimdEnabled()
// Experimental opcodes. We have no text parsing support for these yet. The
// tests will be cleaned up and moved into ad-hack.js if the opcodes are

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --wasm-exceptions; --wasm-exnref; skip-if: !wasmExceptionsEnabled()
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_exceptions=true; --setpref=wasm_exnref=true; skip-if: !wasmExceptionsEnabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --wasm-extended-const; --no-wasm-gc; skip-if: !wasmExtendedConstEnabled()
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_extended_const=true; --setpref=wasm_gc=false; skip-if: !wasmExtendedConstEnabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --wasm-function-references; skip-if: !wasmFunctionReferencesEnabled()
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_function_references=true; skip-if: !wasmFunctionReferencesEnabled()

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-tail-calls; skip-if: !wasmTailCallsEnabled()
// |jit-test| --setpref=wasm_tail_calls=true; skip-if: !wasmTailCallsEnabled()
/* Copyright 2021 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --wasm-gc; skip-if: !wasmGcEnabled()
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_gc=true; skip-if: !wasmGcEnabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; skip-if: !wasmMemory64Enabled()
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_memory64=true; skip-if: !wasmMemory64Enabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --wasm-multi-memory; skip-if: !wasmMultiMemoryEnabled()
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_multi_memory=true; skip-if: !wasmMultiMemoryEnabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --wasm-relaxed-simd; skip-if: !wasmRelaxedSimdEnabled()
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_relaxed_simd=true; skip-if: !wasmRelaxedSimdEnabled()

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; test-also=--no-avx; skip-variant-if: --no-avx, !getBuildConfiguration('x86') && !getBuildConfiguration('x64') || getBuildConfiguration('simulator')
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; test-also=--no-avx; skip-variant-if: --no-avx, !getBuildConfiguration('x86') && !getBuildConfiguration('x64') || getBuildConfiguration('simulator')

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --no-wasm-gc
// |jit-test| --setpref=wasm_gc=false
/* Copyright 2021 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

Просмотреть файл

@ -1 +1 @@
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--wasm-test-serialization; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --wasm-tail-calls; skip-if: !wasmTailCallsEnabled()
|jit-test| test-also=--wasm-compiler=optimizing; test-also=--wasm-compiler=baseline; test-also=--setpref=wasm_test_serialization=true; test-also=--test-wasm-await-tier2; test-also=--disable-wasm-huge-memory; skip-variant-if: --disable-wasm-huge-memory, !wasmHugeMemorySupported(); local-include:harness/harness.js; --setpref=wasm_tail_calls=true; skip-if: !wasmTailCallsEnabled()

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-gc; skip-if: !wasmGcEnabled()
// |jit-test| --setpref=wasm_gc=true; skip-if: !wasmGcEnabled()
var ins = wasmEvalText(`(module
(func $func1)

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --more-compartments; skip-variant-if: --wasm-test-serialization, true; skip-variant-if: --wasm-compiler=ion, true; skip-if: !wasmGcEnabled() || !('Function' in WebAssembly)
// |jit-test| --more-compartments; skip-variant-if: --setpref=wasm_test_serialization=true, true; skip-variant-if: --wasm-compiler=ion, true; skip-if: !wasmGcEnabled() || !('Function' in WebAssembly)
a = newGlobal();
a.b = this;

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --more-compartments; skip-variant-if: --wasm-test-serialization, true; skip-variant-if: --wasm-compiler=ion, true; skip-if: !wasmGcEnabled()
// |jit-test| --more-compartments; skip-variant-if: --setpref=wasm_test_serialization=true, true; skip-variant-if: --wasm-compiler=ion, true; skip-if: !wasmGcEnabled()
var dbg = newGlobal()
dbg.parent = this

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --more-compartments; skip-variant-if: --wasm-test-serialization, true; skip-variant-if: --wasm-compiler=ion, true
// |jit-test| --more-compartments; skip-variant-if: --setpref=wasm_test_serialization=true, true; skip-variant-if: --wasm-compiler=ion, true
dbg = newGlobal();
dbg.b = this;
dbg.eval("(" + function() {

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| skip-variant-if: --wasm-test-serialization, true; skip-if: !wasmGcEnabled()
// |jit-test| skip-variant-if: --setpref=wasm_test_serialization=true, true; skip-if: !wasmGcEnabled()
gczeal(18)
function a(str, imports) {

Просмотреть файл

@ -1 +1 @@
|jit-test| --wasm-tail-calls; test-also=--wasm-compiler=baseline; test-also=--wasm-compiler=ion; test-also=--wasm-test-serialization; skip-if: !wasmTailCallsEnabled(); include:wasm.js
|jit-test| --setpref=wasm_tail_calls=true; test-also=--wasm-compiler=baseline; test-also=--wasm-compiler=ion; test-also=--setpref=wasm_test_serialization=true; skip-if: !wasmTailCallsEnabled(); include:wasm.js

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-exceptions; skip-if: !wasmExceptionsEnabled()
// |jit-test| --setpref=wasm_exceptions=true; skip-if: !wasmExceptionsEnabled()
// Simple test with return_call.
var ins = wasmEvalText(`(module

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-function-references; --wasm-gc; skip-if: !wasmGcEnabled() || getBuildConfiguration("simulator")
// |jit-test| --setpref=wasm_function_references=true; --setpref=wasm_gc=true; skip-if: !wasmGcEnabled() || getBuildConfiguration("simulator")
// Tests GC references passed as arguments during return calls.
// Similar to js/src/jit-test/tests/wasm/gc/trailers-gc-stress.js

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| --wasm-gc; skip-if: !wasmGcEnabled()
// |jit-test| --setpref=wasm_gc=true; skip-if: !wasmGcEnabled()
var ins = wasmEvalText(`(module
(type $t (func (param i64 i64 funcref) (result i64)))
(elem declare func $fac-acc $fac-acc-broken)

Просмотреть файл

@ -724,12 +724,6 @@ bool shell::enableWasm = false;
bool shell::enableSharedMemory = SHARED_MEMORY_DEFAULT;
bool shell::enableWasmBaseline = false;
bool shell::enableWasmOptimizing = false;
#define WASM_FEATURE(NAME, _, STAGE, ...) \
bool shell::enableWasm##NAME = STAGE != WasmFeatureStage::Experimental;
JS_FOR_WASM_FEATURES(WASM_FEATURE);
#undef WASM_FEATURE
bool shell::enableWasmVerbose = false;
bool shell::enableTestWasmAwaitTier2 = false;
bool shell::enableSourcePragmas = true;
@ -11015,9 +11009,6 @@ static void SetWorkerContextOptions(JSContext* cx) {
.setWasm(enableWasm)
.setWasmBaseline(enableWasmBaseline)
.setWasmIon(enableWasmOptimizing)
#define WASM_FEATURE(NAME, ...) .setWasm##NAME(enableWasm##NAME)
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE
.setWasmVerbose(enableWasmVerbose)
.setTestWasmAwaitTier2(enableTestWasmAwaitTier2)
@ -11832,20 +11823,8 @@ bool InitOptionParser(OptionParser& op) {
!op.addBoolOption('\0', "test-wasm-await-tier2",
"Forcibly activate tiering and block "
"instantiation on completion of tier2") ||
#define WASM_FEATURE(NAME, LOWER_NAME, STAGE, COMPILE_PRED, COMPILER_PRED, \
FLAG_PRED, FLAG_FORCE_ON, FLAG_FUZZ_ON, SHELL, ...) \
!op.addBoolOption('\0', "no-wasm-" SHELL, \
STAGE == WasmFeatureStage::Experimental \
? "No-op." \
: "Disable wasm " SHELL " feature.") || \
!op.addBoolOption('\0', "wasm-" SHELL, \
STAGE == WasmFeatureStage::Experimental \
? "Enable wasm " SHELL " feature." \
: "No-op.") ||
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE
!op.addBoolOption('\0', "no-native-regexp",
"Disable native regexp compilation") ||
!op.addBoolOption('\0', "no-native-regexp",
"Disable native regexp compilation") ||
!op.addIntOption(
'\0', "regexp-warmup-threshold", "COUNT",
"Wait for COUNT invocations before compiling regexps to native code "
@ -12213,7 +12192,21 @@ bool InitOptionParser(OptionParser& op) {
'\0', "list-prefs",
"Print list of prefs that can be set with --setpref.") ||
!op.addBoolOption('\0', "use-fdlibm-for-sin-cos-tan",
"Use fdlibm for Math.sin, Math.cos, and Math.tan")) {
"Use fdlibm for Math.sin, Math.cos, and Math.tan") ||
!op.addBoolOption('\0', "wasm-gc",
"Enable WebAssembly gc proposal.") ||
!op.addBoolOption('\0', "wasm-relaxed-simd",
"Enable WebAssembly relaxed-simd proposal.") ||
!op.addBoolOption('\0', "wasm-multi-memory",
"Enable WebAssembly multi-memory proposal.") ||
!op.addBoolOption('\0', "wasm-memory-control",
"Enable WebAssembly memory-control proposal.") ||
!op.addBoolOption('\0', "wasm-memory64",
"Enable WebAssembly memory64 proposal.") ||
!op.addBoolOption('\0', "wasm-tail-calls",
"Enable WebAssembly tail-calls proposal.") ||
!op.addBoolOption('\0', "wasm-js-string-builtins",
"Enable WebAssembly js-string-builtins proposal.")) {
return false;
}
@ -12265,6 +12258,19 @@ bool SetGlobalOptionsPreJSInit(const OptionParser& op) {
JS::Prefs::setAtStartup_property_error_message_fix(
!op.getBoolOption("disable-property-error-message-fix"));
if (op.getBoolOption("wasm-gc") ||
op.getBoolOption("wasm-relaxed-simd") ||
op.getBoolOption("wasm-multi-memory") ||
op.getBoolOption("wasm-memory-control") ||
op.getBoolOption("wasm-memory64") ||
op.getBoolOption("wasm-tail-calls") ||
op.getBoolOption("wasm-js-string-builtins")) {
fprintf(
stderr,
"Wasm shell flags are now using prefs, use -P wasm_feature instead.\n");
return false;
}
if (op.getBoolOption("list-prefs")) {
ListJSPrefs();
return false;
@ -12556,17 +12562,6 @@ bool SetContextWasmOptions(JSContext* cx, const OptionParser& op) {
}
}
#define WASM_FEATURE(NAME, LOWER_NAME, STAGE, COMPILE_PRED, COMPILER_PRED, \
FLAG_PRED, FLAG_FORCE_ON, FLAG_FUZZ_ON, SHELL, ...) \
if (STAGE == WasmFeatureStage::Experimental) { \
enableWasm##NAME = op.getBoolOption("wasm-" SHELL); \
} else { \
enableWasm##NAME = !op.getBoolOption("no-wasm-" SHELL); \
}
JS_FOR_WASM_FEATURES(WASM_FEATURE);
#undef WASM_FEATURE
enableWasmVerbose = op.getBoolOption("wasm-verbose");
enableTestWasmAwaitTier2 = op.getBoolOption("test-wasm-await-tier2");
@ -12575,11 +12570,7 @@ bool SetContextWasmOptions(JSContext* cx, const OptionParser& op) {
.setWasm(enableWasm)
.setWasmForTrustedPrinciples(enableWasm)
.setWasmBaseline(enableWasmBaseline)
.setWasmIon(enableWasmOptimizing)
#define WASM_FEATURE(NAME, ...) .setWasm##NAME(enableWasm##NAME)
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE
;
.setWasmIon(enableWasmOptimizing);
#ifndef __wasi__
// This must be set before self-hosted code is initialized, as self-hosted
@ -12598,12 +12589,6 @@ bool SetContextWasmOptions(JSContext* cx, const OptionParser& op) {
// Also the following are to be propagated.
const char* to_propagate[] = {
# define WASM_FEATURE(NAME, LOWER_NAME, STAGE, COMPILE_PRED, COMPILER_PRED, \
FLAG_PRED, FLAG_FORCE_ON, FLAG_FUZZ_ON, SHELL, ...) \
STAGE == WasmFeatureStage::Experimental ? "--wasm-" SHELL \
: "--no-wasm-" SHELL,
JS_FOR_WASM_FEATURES(WASM_FEATURE)
# undef WASM_FEATURE
// Compiler selection options
"--test-wasm-await-tier2",
NULL};

Просмотреть файл

@ -112,11 +112,6 @@ extern bool enableWasm;
extern bool enableSharedMemory;
extern bool enableWasmBaseline;
extern bool enableWasmOptimizing;
#define WASM_FEATURE(NAME, ...) extern bool enableWasm##NAME;
JS_FOR_WASM_FEATURES(WASM_FEATURE);
#undef WASM_FEATURE
extern bool enableWasmVerbose;
extern bool enableTestWasmAwaitTier2;
extern bool enableSourcePragmas;

Просмотреть файл

@ -21,6 +21,7 @@
#include "jit/AtomicOperations.h"
#include "jit/JitContext.h"
#include "jit/JitOptions.h"
#include "js/Prefs.h"
#include "util/StringBuffer.h"
#include "vm/JSContext.h"
#include "vm/Realm.h"
@ -56,13 +57,13 @@ static inline bool WasmThreadsFlag(JSContext* cx) {
JS_FOR_WASM_FEATURES(WASM_FEATURE);
#undef WASM_FEATURE
#define WASM_FEATURE(NAME, LOWER_NAME, STAGE, COMPILE_PRED, COMPILER_PRED, \
FLAG_PRED, FLAG_FORCE_ON, ...) \
static inline bool Wasm##NAME##Flag(JSContext* cx) { \
if (!(COMPILE_PRED)) { \
return false; \
} \
return ((FLAG_PRED) && cx->options().wasm##NAME()) || (FLAG_FORCE_ON); \
#define WASM_FEATURE(NAME, LOWER_NAME, COMPILE_PRED, COMPILER_PRED, FLAG_PRED, \
FLAG_FORCE_ON, FLAG_FUZZ_ON, PREF) \
static inline bool Wasm##NAME##Flag(JSContext* cx) { \
if (!(COMPILE_PRED)) { \
return false; \
} \
return ((FLAG_PRED) && JS::Prefs::wasm_##PREF()) || (FLAG_FORCE_ON); \
}
JS_FOR_WASM_FEATURES(WASM_FEATURE);
#undef WASM_FEATURE
@ -219,10 +220,9 @@ bool wasm::AnyCompilerAvailable(JSContext* cx) {
// compiler that can support the feature. Subsequent compiler selection must
// ensure that only compilers that actually support the feature are used.
#define WASM_FEATURE(NAME, LOWER_NAME, STAGE, COMPILE_PRED, COMPILER_PRED, \
...) \
bool wasm::NAME##Available(JSContext* cx) { \
return Wasm##NAME##Flag(cx) && (COMPILER_PRED); \
#define WASM_FEATURE(NAME, LOWER_NAME, COMPILE_PRED, COMPILER_PRED, ...) \
bool wasm::NAME##Available(JSContext* cx) { \
return Wasm##NAME##Flag(cx) && (COMPILER_PRED); \
}
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE

Просмотреть файл

@ -812,11 +812,6 @@ void xpc::SetPrefableContextOptions(JS::ContextOptions& options) {
.setWasmIon(Preferences::GetBool(JS_OPTIONS_DOT_STR "wasm_optimizingjit"))
.setWasmBaseline(
Preferences::GetBool(JS_OPTIONS_DOT_STR "wasm_baselinejit"))
#define WASM_FEATURE(NAME, LOWER_NAME, STAGE, COMPILE_PRED, COMPILER_PRED, \
FLAG_PRED, FLAG_FORCE_ON, FLAG_FUZZ_ON, SHELL, PREF) \
.setWasm##NAME(Preferences::GetBool(JS_OPTIONS_DOT_STR "wasm_" PREF))
JS_FOR_WASM_FEATURES(WASM_FEATURE)
#undef WASM_FEATURE
.setWasmVerbose(Preferences::GetBool(JS_OPTIONS_DOT_STR "wasm_verbose"))
.setAsyncStack(Preferences::GetBool(JS_OPTIONS_DOT_STR "asyncstack"))
.setAsyncStackCaptureDebuggeeOnly(Preferences::GetBool(

Просмотреть файл

@ -7681,57 +7681,73 @@
value: true
mirror: always
#if defined(ENABLE_WASM_RELAXED_SIMD)
- name: javascript.options.wasm_relaxed_simd
type: bool
#if defined(ENABLE_WASM_RELAXED_SIMD)
value: @IS_NIGHTLY_BUILD@
#else
value: false
#endif
mirror: always
#endif // defined(ENABLE_WASM_RELAXED_SIMD)
set_spidermonkey_pref: startup
#if defined(ENABLE_WASM_MOZ_INTGEMM)
- name: javascript.options.wasm_moz_intgemm
type: bool
#if defined(ENABLE_WASM_MOZ_INTGEMM)
value: @IS_NIGHTLY_BUILD@
#else
value: false
#endif
mirror: always
#endif // defined(ENABLE_WASM_MOZ_INTGEMM)
set_spidermonkey_pref: startup
#if defined(ENABLE_WASM_EXTENDED_CONST)
- name: javascript.options.wasm_extended_const
type: bool
#if defined(ENABLE_WASM_EXTENDED_CONST)
value: true
#else
value: false
#endif
mirror: always
#endif // defined(ENABLE_WASM_EXTENDED_CONST)
set_spidermonkey_pref: startup
- name: javascript.options.wasm_exceptions
type: bool
value: true
mirror: always
set_spidermonkey_pref: startup
- name: javascript.options.wasm_exnref
type: bool
value: @IS_EARLY_BETA_OR_EARLIER@
mirror: always
set_spidermonkey_pref: startup
#if defined(ENABLE_WASM_FUNCTION_REFERENCES)
- name: javascript.options.wasm_function_references
type: bool
#if defined(ENABLE_WASM_FUNCTION_REFERENCES)
value: true
#else
value: false
#endif
mirror: always
#endif // defined(ENABLE_WASM_FUNCTION_REFERENCES)
set_spidermonkey_pref: startup
#if defined(ENABLE_WASM_GC)
- name: javascript.options.wasm_gc
type: bool
#if defined(ENABLE_WASM_GC)
value: true
#else
value: false
#endif
mirror: always
#endif // defined(ENABLE_WASM_GC)
set_spidermonkey_pref: startup
#if defined(ENABLE_WASM_MEMORY_CONTROL)
- name: javascript.options.wasm_memory_control
type: bool
value: false
mirror: always
#endif // defined(ENABLE_WASM_MEMORY_CONTROL)
set_spidermonkey_pref: startup
#if defined(ENABLE_WASM_SIMD)
#if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_X86)
@ -7744,19 +7760,43 @@
#endif
#endif
#if defined(ENABLE_WASM_MEMORY64)
- name: javascript.options.wasm_memory64
type: bool
#if defined(ENABLE_WASM_MEMORY64)
value: @IS_NIGHTLY_BUILD@
#else
value: false
#endif
mirror: always
#endif // defined(ENABLE_WASM_MEMORY64)
set_spidermonkey_pref: startup
- name: javascript.options.wasm_multi_memory
type: bool
value: false
mirror: always
set_spidermonkey_pref: startup
- name: javascript.options.wasm_js_string_builtins
type: bool
value: false
mirror: always
set_spidermonkey_pref: startup
#if defined(ENABLE_WASM_TAIL_CALLS)
- name: javascript.options.wasm_tail_calls
type: bool
#if defined(ENABLE_WASM_TAIL_CALLS)
value: true
#else
value: false
#endif
mirror: always
#endif // defined(ENABLE_WASM_TAIL_CALLS)
set_spidermonkey_pref: startup
- name: javascript.options.wasm_test_serialization
type: bool
value: false
mirror: always
set_spidermonkey_pref: startup
# Support for pretenuring allocations based on their allocation site.
- name: javascript.options.site_based_pretenuring