You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-129040: Use wasm-gc to handle pointer casts in wasi
This makes it so that in wasi builds if `-DPY_CALL_TRAMPOLINE` is passed, a call
trampoline adaptor is used to prevent traps when there is a call signature
mismatch between a C slot handler and the signature that the interpreter uses to
call it.
This requires Clang >= 22. PEP 11 specifies that builds of Python 3.15 use WASI
SDK version 33 which includes clang 23.1.0, so this could be used with Python
3.15 WASI builds but not earlier ones.
It requires a WebAssembly runtime that supports wasm-gc. Wasmtime has supported
wasm-gc since version 27.0 released November 25, 2024. Some other runtimes still
don't support it, but for those runtimes people can use builds with the
trampoline disabled.
I also removed the Emscripten trampoline support for JS runtimes with no wasm-gc
support. This removes a lot of implementation complexity and allows WASI and
Emscripten to share code. The main concern is that it drops support for some
very old iPhones, but every iPhone model released since 2018 is compatible with
versions of Safari that support wasm-gc.
I also added tests that define handlers with various wrong numbers of arguments.
The tests also run on non-webassembly platforms since they should work there as
well.
0 commit comments