diff options
author | Hood Chatham <roberthoodchatham@gmail.com> | 2023-09-15 22:04:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-15 22:04:21 (GMT) |
commit | 6b179adb8c05801bf069121b360531d135ee3f44 (patch) | |
tree | 0ef8079fe12fed536e09162574dd759cf59b3cb1 /configure.ac | |
parent | 59073c9ab8eb8db9304f16c46086ccc525e82570 (diff) | |
download | cpython-6b179adb8c05801bf069121b360531d135ee3f44.zip cpython-6b179adb8c05801bf069121b360531d135ee3f44.tar.gz cpython-6b179adb8c05801bf069121b360531d135ee3f44.tar.bz2 |
gh-106213: Make Emscripten trampolines work with JSPI (GH-106219)
There is a WIP proposal to enable webassembly stack switching which have been
implemented in v8:
https://github.com/WebAssembly/js-promise-integration
It is not possible to switch stacks that contain JS frames so the Emscripten JS
trampolines that allow calling functions with the wrong number of arguments
don't work in this case. However, the js-promise-integration proposal requires
the [type reflection for Wasm/JS API](https://github.com/WebAssembly/js-types)
proposal, which allows us to actually count the number of arguments a function
expects.
For better compatibility with stack switching, this PR checks if type reflection
is available, and if so we use a switch block to decide the appropriate
signature. If type reflection is unavailable, we should use the current EMJS
trampoline.
We cache the function argument counts since when I didn't cache them performance
was negatively affected.
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 843f2b2..34958a1 100644 --- a/configure.ac +++ b/configure.ac @@ -4593,8 +4593,8 @@ PLATFORM_OBJS= AS_CASE([$ac_sys_system], [Emscripten], [ - AS_VAR_APPEND([PLATFORM_OBJS], [' Python/emscripten_signal.o']) - AS_VAR_APPEND([PLATFORM_HEADERS], [' $(srcdir)/Include/internal/pycore_emscripten_signal.h']) + AS_VAR_APPEND([PLATFORM_OBJS], [' Python/emscripten_signal.o Python/emscripten_trampoline.o']) + AS_VAR_APPEND([PLATFORM_HEADERS], [' $(srcdir)/Include/internal/pycore_emscripten_signal.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h']) ], ) AC_SUBST([PLATFORM_HEADERS]) |