Multi-value returns in baseline wasm compiler
Categories
(Core :: JavaScript: WebAssembly, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: wingo, Assigned: wingo)
References
Details
Attachments
(2 files)
The attached patch will start adding support for multi-value returns in the baseline wasm compiler.
Assignee | ||
Comment 1•5 years ago
|
||
This patch implements one half of support for multi-value returns in the
baseline compiler.
The idea is that when you have a function that has stack return values,
it will receive an additional synthetic argument: a pointer to the stack
results area. The layout of this area is the same as that understood by
BaseCompiler::pushBlockResults.
When compiling a function that has stack results, the stack result area
pointer will come in either in a register or on the stack. If it's on
the stack we record that offset and will load a pointer at that offset
when returning values. If the pointer is in a register, it gets spilled
to the stack after the spilled copies of previous register arguments.
When calling a function that has multiple return values, we bump the
stack pointer and pass an additional argument to the callee: the pointer
to that stack area. After the call, in the baseline compiler, it may be
that we need to shuffle any stack results down, because incoming
arguments are consumed by the call.
Note that support for actually returning multiple values is not yet
implemented in this patch; we're just adding infra. Also note that Ion
support isn't there yet either. However all tests pass, because no
FuncType that has more than one result gets past the validator.
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
This commit enables multi-value returns in baseline-to-baseline calls.
Comment 4•5 years ago
|
||
Backed out for bustage on WasmBaselineCompile.cpp
backout: https://hg.mozilla.org/integration/autoland/rev/e51924303b7b1ad280aca7eeded02b3fb690df4f
failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=281382275&repo=autoland&lineNumber=5198
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - In file included from Unified_cpp_js_src_wasm0.cpp:11:
[task 2019-12-16T16:09:25.107Z] 16:09:25 ERROR - /builds/worker/workspace/build/src/js/src/wasm/WasmBaselineCompile.cpp:1730:10: error: no matching member function for call to 'movePtr'
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - masm.movePtr(sp_, dest);
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO -^
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - /builds/worker/workspace/build/src/js/src/jit/arm64/MacroAssembler-arm64.h:733:8: note: candidate function not viable: no known conversion from 'js::jit::RegisterOrSP' to 'js::jit::Register' for 1st argument
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - void movePtr(Register src, Register dest) {
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - ^
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - /builds/worker/workspace/build/src/js/src/jit/arm64/MacroAssembler-arm64.h:736:8: note: candidate function not viable: no known conversion from 'js::jit::RegisterOrSP' to 'js::jit::ImmWord' for 1st argument
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - void movePtr(ImmWord imm, Register dest) {
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - ^
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - /builds/worker/workspace/build/src/js/src/jit/arm64/MacroAssembler-arm64.h:739:8: note: candidate function not viable: no known conversion from 'js::jit::RegisterOrSP' to 'js::jit::ImmPtr' for 1st argument
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - void movePtr(ImmPtr imm, Register dest) {
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - ^
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - /builds/worker/workspace/build/src/js/src/jit/arm64/MacroAssembler-arm64.h:742:8: note: candidate function not viable: no known conversion from 'js::jit::RegisterOrSP' to 'wasm::SymbolicAddress' for 1st argument
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - void movePtr(wasm::SymbolicAddress imm, Register dest) {
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - ^
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - /builds/worker/workspace/build/src/js/src/jit/arm64/MacroAssembler-arm64.h:746:8: note: candidate function not viable: no known conversion from 'js::jit::RegisterOrSP' to 'js::jit::ImmGCPtr' for 1st argument
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - void movePtr(ImmGCPtr imm, Register dest) {
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - ^
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - /builds/worker/workspace/build/src/js/src/jit/MacroAssembler.h:3030:8: note: candidate function not viable: no known conversion from 'js::jit::RegisterOrSP' to 'js::jit::TrampolinePtr' for 1st argument
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - void movePtr(TrampolinePtr ptr, Register dest) {
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - ^
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - 1 error generated.
[task 2019-12-16T16:09:25.107Z] 16:09:25 ERROR - make[4]: *** [/builds/worker/workspace/build/src/config/rules.mk:738: Unified_cpp_js_src_wasm0.o] Error 1
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/js/src/wasm'
[task 2019-12-16T16:09:25.107Z] 16:09:25 ERROR - make[3]: *** [/builds/worker/workspace/build/src/config/recurse.mk:74: js/src/wasm/target-objects] Error 2
[task 2019-12-16T16:09:25.107Z] 16:09:25 INFO - make[3]: *** Waiting for unfinished jobs....
Comment 5•5 years ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:wingo, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 6•5 years ago
|
||
Thanks for the landing and sheriffing, and apologies for the delay as I was on holidays. These patches do not need to land before the release, so I will hold off on relanding until after the branch.
Comment 8•5 years ago
|
||
Backed out changeset 63f89c300859 (bug 1603140) for causing wasm related bustages
backout: https://hg.mozilla.org/integration/autoland/rev/33d7640d6bad33e6f0401f9f5ef8ea8946780b9d
Assignee | ||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
bugherder |
Assignee | ||
Comment 11•5 years ago
|
||
Reopening as there are patches yet to land. (Is there a phab flag to set to prevent the bug from being closed?)
Updated•5 years ago
|
Comment 12•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 13•5 years ago
|
||
bugherder |
Comment 14•5 years ago
|
||
(In reply to Andy Wingo [:wingo] from comment #11)
Reopening as there are patches yet to land. (Is there a phab flag to set to prevent the bug from being closed?)
You need to set the leave-open keyword on the bugzilla bug.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Description
•