WebAssembly / WebAssembly/binaryen
More precise livenes analysis for locals under Asyncify
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
I've been trying to add an externref to emscripten here:
https://github.com/emscripten-core/emscripten/pull/26964
And its failing with: Fatal: Asyncify does not yet support non-number types, like references (see https://github.com/WebAssembly/binaryen/issues/3739).
Rather than push to land the fix to #3739, I think my particulur use case might be fixed by resolving this TODO in Asyncify:
https://github.com/WebAssembly/binaryen/blob/3029fbb717390af5d49914ba635b5458dd1c6efa/src/passes/Asyncify.cpp#L1597-L1599
The externref I'm using is not live after the call to the suspending function, so it should not need to be saved or restored.
How hard would it be to fix that TODO? Presumably it would make Asyncify in general more efficient?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/passes/Asyncify.cpp at the TODO around lines 1597–1599, and review the linked Binaryen issue #3739 and the motivating Emscripten pull request. Determine how liveness after a suspending call should affect saving externref locals; done means dead references are omitted while supported Asyncify behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, wasm
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100