Skip to content

Commit f32698b

Browse files
authored
Add a feature flag for GC in the component model (#2165)
* Add a feature flag for GC in the component model This is the first baby step towards integrating support for Wasm GC into the component model and its canonical ABI. * update test expectations
1 parent 040a222 commit f32698b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/wasmparser/src/features.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ define_wasm_features! {
139139
/// has any associated constants. When `features` are disabled all values
140140
/// for proposals are fixed at compile time to their defaults.
141141
#[derive(Hash, Debug, Copy, Clone, Eq, PartialEq)]
142-
pub struct WasmFeatures: u32 {
142+
pub struct WasmFeatures: u64 {
143143
/// The WebAssembly `mutable-global` proposal.
144144
pub mutable_global: MUTABLE_GLOBAL(1) = true;
145145
/// The WebAssembly `saturating-float-to-int` proposal.
@@ -259,6 +259,11 @@ define_wasm_features! {
259259
/// Corresponds to the 🔧 character in
260260
/// <https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md>.
261261
pub cm_fixed_size_list: CM_FIXED_SIZE_LIST(1 << 31) = false;
262+
/// Support for Wasm GC in the component model proposal.
263+
///
264+
/// Corresponds to the 🛸 character in
265+
/// <https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md>.
266+
pub cm_gc: CM_GC(1 << 32) = false;
262267
}
263268
}
264269

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
error: invalid value 'unknown' for '--features <FEATURES>': unknown feature `unknown`
2-
Valid features: mutable-global, saturating-float-to-int, sign-extension, reference-types, multi-value, bulk-memory, simd, relaxed-simd, threads, shared-everything-threads, tail-call, floats, multi-memory, exceptions, memory64, extended-const, component-model, function-references, memory-control, gc, custom-page-sizes, legacy-exceptions, gc-types, stack-switching, wide-arithmetic, cm-values, cm-nested-names, cm-async, cm-async-stackful, cm-async-builtins, cm-error-context, cm-fixed-size-list, mvp, wasm1, wasm2, wasm3, all
2+
Valid features: mutable-global, saturating-float-to-int, sign-extension, reference-types, multi-value, bulk-memory, simd, relaxed-simd, threads, shared-everything-threads, tail-call, floats, multi-memory, exceptions, memory64, extended-const, component-model, function-references, memory-control, gc, custom-page-sizes, legacy-exceptions, gc-types, stack-switching, wide-arithmetic, cm-values, cm-nested-names, cm-async, cm-async-stackful, cm-async-builtins, cm-error-context, cm-fixed-size-list, cm-gc, mvp, wasm1, wasm2, wasm3, all
33

44
For more information, try '--help'.

0 commit comments

Comments
 (0)