Skip to content

Commit 8fd6208

Browse files
authored
Flag pulley as not supporting most wasm features (#9648)
This commit updates `Config::compiler_panicking_wasm_features` to include most wasm features for pulley targets. These backends in Cranelift don't support most instructions at this time and have lots of `todo!()`-related panics here and there. This won't completely cover all panics but it's at least a start.
1 parent 7968af6 commit 8fd6208

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

crates/wasmtime/src/config.rs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,42 @@ impl Config {
18981898
fn compiler_panicking_wasm_features(&self) -> WasmFeatures {
18991899
#[cfg(any(feature = "cranelift", feature = "winch"))]
19001900
match self.compiler_config.strategy {
1901-
None | Some(Strategy::Cranelift) => WasmFeatures::empty(),
1901+
None | Some(Strategy::Cranelift) => match self.compiler_target().architecture {
1902+
// Pulley doesn't support most of wasm at this time and there's
1903+
// lots of panicking bits and pieces within the backend. This
1904+
// doesn't fully cover all panicking cases but it's at least a
1905+
// starting place to have a ratchet. As the pulley backend is
1906+
// developed this'll get filtered down over time.
1907+
target_lexicon::Architecture::Pulley32 | target_lexicon::Architecture::Pulley64 => {
1908+
WasmFeatures::SATURATING_FLOAT_TO_INT
1909+
| WasmFeatures::SIGN_EXTENSION
1910+
| WasmFeatures::REFERENCE_TYPES
1911+
| WasmFeatures::MULTI_VALUE
1912+
| WasmFeatures::BULK_MEMORY
1913+
| WasmFeatures::SIMD
1914+
| WasmFeatures::RELAXED_SIMD
1915+
| WasmFeatures::THREADS
1916+
| WasmFeatures::SHARED_EVERYTHING_THREADS
1917+
| WasmFeatures::TAIL_CALL
1918+
| WasmFeatures::FLOATS
1919+
| WasmFeatures::MULTI_MEMORY
1920+
| WasmFeatures::EXCEPTIONS
1921+
| WasmFeatures::MEMORY64
1922+
| WasmFeatures::EXTENDED_CONST
1923+
| WasmFeatures::FUNCTION_REFERENCES
1924+
| WasmFeatures::MEMORY_CONTROL
1925+
| WasmFeatures::GC
1926+
| WasmFeatures::CUSTOM_PAGE_SIZES
1927+
| WasmFeatures::LEGACY_EXCEPTIONS
1928+
| WasmFeatures::GC_TYPES
1929+
| WasmFeatures::STACK_SWITCHING
1930+
| WasmFeatures::WIDE_ARITHMETIC
1931+
}
1932+
1933+
// Other Cranelift backends are either 100% missing or complete
1934+
// at this time, so no need to further filter.
1935+
_ => WasmFeatures::empty(),
1936+
},
19021937
Some(Strategy::Winch) => {
19031938
let mut unsupported = WasmFeatures::GC
19041939
| WasmFeatures::FUNCTION_REFERENCES

0 commit comments

Comments
 (0)