Open Bug 1571996 (wasm-tail-calls) Opened 5 years ago Updated 3 months ago

[meta] Implement WebAssembly tail calls proposal

Categories

(Core :: JavaScript: WebAssembly, task, P3)

task

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.

Depends on: 1571998
Depends on: 1572400
Depends on: 1573179
Priority: -- → P3

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

Assignee: wingo → nobody
Depends on: 1747787
Blocks: 1755625
No longer depends on: 1747787

I'll rebase Lars' tail calls patches to the current tree.

Severity: normal → S3
Depends on: 1846762
Depends on: 1846789
Depends on: 1849761
Depends on: 1850989
Depends on: 1855288
Depends on: 1860906
You need to log in before you can comment on or make changes to this bug.