GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Emscripten JS trampolines do not interact well with wasm stack switching · Issue #106213 · python/cpython

Emscripten JS trampolines do not interact well with wasm stack switching #106213

New issue
Copy link
New issue
Copy link
Closed
Closed
Emscripten JS trampolines do not interact well with wasm stack switching#106213
Copy link
Labels
OS-wasi

Description

@hoodmane
hoodmane
opened on Jun 28, 2023
Issue body actions

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 proposal, which allows us to actually count the number of arguments a function expects. I propose that for better compatibility with stack switching, we check 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.

I'm working on a patch for this.

Linked PRs

  • gh-106213: Make Emscripten trampolines work with JSPI #106219
  • gh-106213: Shorten Emscripten wasm-gc trampoline by a little #133984
  • [3.14] gh-106213: Shorten Emscripten wasm-gc trampoline by a little (GH-133984) #134376

Activity

  1. AlexWaygood
    added
    OS-wasi
    on Jun 28, 2023
  2. brettcannon
    added a commit that references this issue on Sep 15, 2023

    gh-106213: Make Emscripten trampolines work with JSPI (GH-106219)

    6b179ad
  3. csm10495
    added a commit that references this issue on Sep 28, 2023

    pythongh-106213: Make Emscripten trampolines work with JSPI (pythonGH…

    f9cabbf
  4. brettcannon
    closed this as completedon Oct 19, 2023
  5. hoodmane
    added a commit that references this issue on May 13, 2025

    pythongh-106213 Shorten Emscripten trampolines by a little

    de6ffa6
  6. freakboy3742
    added a commit that references this issue on May 20, 2025

    gh-106213: Shorten Emscripten wasm-gc trampoline by a little (#133984)

    3b7888b
  7. miss-islington
    added a commit that references this issue on May 20, 2025

    pythongh-106213: Shorten Emscripten wasm-gc trampoline by a little (p…

    f4a6798
  8. freakboy3742
    added a commit that references this issue on May 20, 2025

    [3.14] gh-106213: Shorten Emscripten wasm-gc trampoline by a little (G…

    2d90cc8
  9. lkollar
    added a commit that references this issue on May 26, 2025

    pythongh-106213: Shorten Emscripten wasm-gc trampoline by a little (p…

    b42ee0a
  10. Pranjal095
    added a commit that references this issue on Jul 12, 2025

    pythongh-106213: Shorten Emscripten wasm-gc trampoline by a little (p…

    3537a59
  11. taegyunkim
    added a commit that references this issue on Aug 4, 2025

    pythongh-106213: Shorten Emscripten wasm-gc trampoline by a little (p…

    273e67c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-wasi

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.