[Webkit-unassigned] [Bug 215275] Support for WebAssembly tail calls
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Apr 8 12:59:17 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=215275
--- Comment #4 from tom at leaningtech.com ---
As a follow up:
This is a WIP patch to gather some feedback before potentially going further.
Known limitations:
- B3 and AIR are stubbed
- probably some portability issues (only tested on x86_64)
- tests could be more extensive (multiple return values, recursive calls etc..)
- some thinking could be put into formatting the code in slowPathForWasmReturnCall
>From the caller's point of view, this consists of reusing the previous frame with the callee's stack arguments/return values.
Right now, a slowPathForWasmTailCall is defined in WebAssembly.asm and will be only invoked for tail variants of call and call_indirect.
Conceptually it is a merge between slowPathForWasmCall and prepareForTailCall, that deals with passing arguments via registers.
The numberOfCallerStackArguments is also encoded in the corresponding bytecode.
Beside formatting and naming in the patch I'd like to discuss the viability of the implementation in the interpreter. In the context of LLIntPlan I didn't find a satisfactory way to JIT a specific entry thunk, and adding a dynamic check ( similar to what happens in JS) made less sense than creating a slowPath for tail variant of calls in the interpreter.
I also included some tests that cover basic cases.
For reference:
https://github.com/WebAssembly/tail-call
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220408/b442422a/attachment.htm>
More information about the webkit-unassigned
mailing list