[meta] Implement WebAssembly tail calls proposal
Categories
(Core :: JavaScript: WebAssembly, task, P3)
Tracking
()
People
(Reporter: wingo, Unassigned)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Keywords: meta)
The WebAssembly tail-call proposal adds two new opcodes to the binary format: return_call
and return_call_indirect
. These are the same as call
and call_indirect
, except that they are tail calls.
To make a take call, the engine logically replaces the active stack frame with a call to the callee, instead of pushing a new frame on the stack. In the best case of a call from a function without spilled arguments to a function without spilled arguments, the tail call can be implemented as a simple jmp
to the destination code (i.e., skipping any prologue).
The proposal is currently (August 2019) in phase 3 (implementation) of the WebAssembly standardization process. There is an implementation in V8 behind a flag.
Updated•5 years ago
|
Comment 1•4 years ago
|
||
A summary of how this issue is a blocker for Wasm Phase 3/4 progress is here:
https://medium.com/leaningtech/extreme-webassembly-2-the-sad-state-of-webassembly-tail-calls-f5d48ef82a87 in the section "Tail call status on SpiderMonkey/Firefox" . Apart from the technical details, Firefox/SpiderMonkey is one of the two required implementations.
This refers to/depends on the ABI issues in 1572400
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Intent-to-prototype sent: https://groups.google.com/a/mozilla.org/g/dev-platform/c/6BIXCsOmJk8
Comment 3•2 years ago
|
||
I'll rebase Lars' tail calls patches to the current tree.
Updated•2 years ago
|
Description
•