Open unicomp21 opened 2 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I hope the mono team will correct me if I am wrong but it looks like explicit tails calls are handled well in Mono-Interpreter (including wasm) but it's unlikely they're handled in WASM-AOT since, as you said, there is no built-in WASM support for that. So maybe mono-aot fallbacks to interp for methods with explicit tail calls inside?
PS: quoting ECMA 335:
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Author: | unicomp21 |
---|---|
Assignees: | - |
Labels: | `question`, `arch-wasm`, `untriaged`, `area-Codegen-meta-mono` |
Milestone: | - |
Is this an argument for having clang target wasm3?
Or maybe clang could target the byte code being used by the mono interpreter?
Egor is correct. The interpreter supports tailcalls, but AOT doesn't.
Or maybe clang could target the byte code being used by the mono interpreter?
The interpreter's bytecode is failry specific to the needs of a .NET runtime. There would not be much value in trying to use it as a general-purpose clang backend.
For Emscripten, it might be possible to use something like Asyncify (or some rewriting approach inspired by Asyncify) to transform C++ coroutines to tailcalls by bouncing back into JS.
Keeping this open - when wasm adds tailcall ops, we should revisit AOT support
wasm tail calls get released in chrome 113, right?
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Could someone hold my hand on this one? Given tail calls are not currently supported in webassembly, how is the "tail" instruction being implemented in Blazor?
Describe the solution you'd like
I'm wondering if we can reuse the same implementation on the emscripten side for co_await, until tail calls land in webassembly?
Additional context
No response