Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/wasm-encoder/src/core/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,14 @@ impl RefType {
},
};

/// Create a new abstract reference type.
pub fn new_abstract(ty: AbstractHeapType, nullable: bool, shared: bool) -> Self {
Self {
nullable,
heap_type: HeapType::Abstract { shared, ty },
}
}

/// Set the nullability of this reference type.
pub fn nullable(mut self, nullable: bool) -> Self {
self.nullable = nullable;
Expand Down
24 changes: 21 additions & 3 deletions crates/wasm-smith/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,17 +551,30 @@ define_config! {
/// Defaults to `true`.
pub relaxed_simd_enabled: bool = true,

/// Determines whether the nontrapping-float-to-int-conversions propsal
/// is enabled.
/// Determines whether the non-trapping float-to-int conversions
/// proposal is enabled.
///
/// Defaults to `true`.
pub saturating_float_to_int_enabled: bool = true,

/// Determines whether the sign-extension-ops propsal is enabled.
/// Determines whether the sign-extension-ops proposal is enabled.
///
/// Defaults to `true`.
pub sign_extension_ops_enabled: bool = true,

/// Determines whether the shared-everything-threads proposal is
/// enabled.
///
/// The [shared-everything-threads] proposal, among other things,
/// extends `shared` attributes to all WebAssembly objects; it builds on
/// the [threads] proposal.
///
/// [shared-everything-threads]: https://github.com/WebAssembly/shared-everything-threads
/// [threads]: https://github.com/WebAssembly/threads
///
/// Defaults to `false`.
pub shared_everything_threads_enabled: bool = false,

/// Determines whether the SIMD proposal is enabled for generating
/// instructions.
///
Expand Down Expand Up @@ -754,6 +767,7 @@ impl<'a> Arbitrary<'a> for Config {
memory64_enabled: false,
custom_page_sizes_enabled: false,
wide_arithmetic_enabled: false,
shared_everything_threads_enabled: false,
};
config.sanitize();
Ok(config)
Expand Down Expand Up @@ -821,6 +835,10 @@ impl Config {
features.set(WasmFeatures::FUNCTION_REFERENCES, self.gc_enabled);
features.set(WasmFeatures::GC, self.gc_enabled);
features.set(WasmFeatures::THREADS, self.threads_enabled);
features.set(
WasmFeatures::SHARED_EVERYTHING_THREADS,
self.shared_everything_threads_enabled,
);
features.set(
WasmFeatures::CUSTOM_PAGE_SIZES,
self.custom_page_sizes_enabled,
Expand Down
Loading