gh-128627: Emscripten: Use wasm-gc based call adaptor if available by hoodmane · Pull Request #128628 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
24 changes: 6 additions & 18 deletions Include/internal/pycore_emscripten_trampoline.h
2 changes: 1 addition & 1 deletion Include/internal/pycore_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ typedef struct pyruntimestate {
#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
// Used in "Python/emscripten_trampoline.c" to choose between type
// reflection trampoline and EM_JS trampoline.
bool wasm_type_reflection_available;
int (*emscripten_count_args_function)(PyCFunctionWithKeywords func);
#endif

/* All the objects that are shared by the runtime's interpreters. */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
For Emscripten builds the function pointer cast call trampoline now uses the
wasm-gc ref.test instruction if it's available instead of Wasm JS type
reflection.
229 changes: 177 additions & 52 deletions Python/emscripten_trampoline.c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems to be using 2-space indenting rather than 4-space for all other C code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've marked this resolved... but it looks like you've gone the opposite direction to what I was intending/suggesting. Python's C code is 4-space indented; the updates you've made here move everything to 2-space. It should be 4-space for consistency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry I misread your comment. It's hard to remember all these different code styles.