Closed Bug 1607200 Opened 10 months ago Closed 7 months ago

Multi-value returns in Ion wasm compiler

Categories

(Core :: Javascript: WebAssembly, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: wingo, Assigned: wingo)

References

Details

Multi-value function returns are mostly done in the baseline compiler (see bug 1603140). Now to be able to test things we should add support for the Ion compiler. However I am less sure how represent things.

There seem to be two separate issues: how to represent stack results, and how to represent register results.

For register results, we could change to make MWasmCall MIR node not define any values. Instead add MWasmRegisterResult that extracts a register result. We would simplify LIR to not have the various LWasmCall nodes specialized on return type, instead replacing with LIR representations of result values with fixed allocations.

The advantage would be that we preserve the ability to have multiple register results. The disadvantage is that it would be a bit of churn. We could leave it as-is and assert that there's only ever one register result.

For stack results, I guess a least-effort approach would be to add a MWasmStackResults node that indicates reserved stack space for results, and to pass this as a synthetic additional argument to MWasmCall instances, if there are stack results. Then after the call we can extract values as MWasmStackResult or so.

WDYT? *
[Y = y'all]

bbouvier mentions that for stack results, we can probably use whatever machinery is there for loading from the stack.

Depends on: 1608121
Depends on: 1609057
Depends on: 1609887
Depends on: 1609889
Blocks: 1620197
Depends on: 1626233

All done!

Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.