diff --git a/crates/wasm-shrink/src/lib.rs b/crates/wasm-shrink/src/lib.rs index cf14d7b9fa..25b7ce4a76 100755 --- a/crates/wasm-shrink/src/lib.rs +++ b/crates/wasm-shrink/src/lib.rs @@ -223,6 +223,7 @@ impl ShrinkRun { bulk_memory: true, simd: true, threads: true, + shared_everything_threads: false, tail_call: true, multi_memory: true, exceptions: true, diff --git a/crates/wasm-smith/tests/common/mod.rs b/crates/wasm-smith/tests/common/mod.rs index cc24eed278..b2396cefe5 100644 --- a/crates/wasm-smith/tests/common/mod.rs +++ b/crates/wasm-smith/tests/common/mod.rs @@ -19,6 +19,7 @@ pub fn parser_features_from_config(config: &Config) -> WasmFeatures { gc: config.gc_enabled, threads: false, + shared_everything_threads: false, floats: true, extended_const: false, component_model: false, diff --git a/crates/wasm-smith/tests/core.rs b/crates/wasm-smith/tests/core.rs index 7286952dc6..d5c1f3070b 100644 --- a/crates/wasm-smith/tests/core.rs +++ b/crates/wasm-smith/tests/core.rs @@ -168,6 +168,7 @@ fn parser_features_from_config(config: &Config) -> WasmFeatures { tail_call: config.tail_call_enabled, threads: false, + shared_everything_threads: false, floats: true, extended_const: false, component_model: false, diff --git a/crates/wasmparser/src/validator.rs b/crates/wasmparser/src/validator.rs index 3d77a48039..272120ced7 100644 --- a/crates/wasmparser/src/validator.rs +++ b/crates/wasmparser/src/validator.rs @@ -218,6 +218,9 @@ pub struct WasmFeatures { pub relaxed_simd: bool, /// The WebAssembly threads proposal (enabled by default) pub threads: bool, + /// The WebAssembly shared-everything-threads proposal; includes new + /// component model built-ins. + pub shared_everything_threads: bool, /// The WebAssembly tail-call proposal (enabled by default) pub tail_call: bool, /// Whether or not floating-point instructions are enabled. @@ -266,6 +269,7 @@ impl WasmFeatures { simd: true, relaxed_simd: true, threads: true, + shared_everything_threads: true, tail_call: true, floats: true, multi_memory: true, @@ -377,6 +381,7 @@ impl Default for WasmFeatures { gc: false, component_model_values: false, component_model_nested_names: false, + shared_everything_threads: false, // On-by-default features (phase 4 or greater). mutable_global: true, diff --git a/fuzz/src/validate.rs b/fuzz/src/validate.rs index c9657a7b98..c1070534c4 100644 --- a/fuzz/src/validate.rs +++ b/fuzz/src/validate.rs @@ -32,6 +32,7 @@ pub fn validate_raw_bytes(u: &mut Unstructured<'_>) -> Result<()> { reference_types: u.arbitrary()?, multi_value: u.arbitrary()?, threads: u.arbitrary()?, + shared_everything_threads: u.arbitrary()?, simd: u.arbitrary()?, component_model: u.arbitrary()?, tail_call: u.arbitrary()?, diff --git a/src/bin/wasm-tools/validate.rs b/src/bin/wasm-tools/validate.rs index 999f8da51d..2352194d82 100644 --- a/src/bin/wasm-tools/validate.rs +++ b/src/bin/wasm-tools/validate.rs @@ -102,6 +102,9 @@ fn parse_features(arg: &str) -> Result { ("function-references", |f| &mut f.function_references), ("simd", |f| &mut f.simd), ("threads", |f| &mut f.threads), + ("shared-everything-threads", |f| { + &mut f.shared_everything_threads + }), ("bulk-memory", |f| &mut f.bulk_memory), ("multi-value", |f| &mut f.multi_value), ("tail-call", |f| &mut f.tail_call), diff --git a/tests/roundtrip.rs b/tests/roundtrip.rs index f30ab5c1d5..cc751bd1da 100644 --- a/tests/roundtrip.rs +++ b/tests/roundtrip.rs @@ -578,6 +578,7 @@ impl TestState { fn wasmparser_validator_for(&self, test: &Path) -> Validator { let mut features = WasmFeatures { threads: true, + shared_everything_threads: false, reference_types: true, simd: true, relaxed_simd: true, @@ -637,6 +638,10 @@ impl TestState { "tail-call" => features.tail_call = true, "memory64" => features.memory64 = true, "component-model" => features.component_model = true, + "shared-everything-threads" => { + features.component_model = true; + features.shared_everything_threads = true; + } "multi-memory" => features.multi_memory = true, "extended-const" => features.extended_const = true, "function-references" => features.function_references = true,