saulecabrera opened PR #10821 from saulecabrera:winch-use-innermost-frame-br-table to bytecodealliance:main:
Prior to this commit, the lowering of
br_tableused the default target as the relative reference to pop ABI results. This approach is not ideal, as it leads to a loss of precision regarding the stack pointer position, causing unmet invariants at jump sites for all other branches.This commit, instead, takes advantage of the fact that all jumps are "outward" and uses the innermost frame to pop ABI results when lowering
br_table. This ensures two main things:
- The stack pointer offset is correctly positioned according to the expectations of the innermost block's end sequence, which will be handled in the next eventual
endsequence.- We meet the jump site invariants introduced by
CodegenContext::br.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
saulecabrera requested wasmtime-compiler-reviewers for a review on PR #10821.
saulecabrera requested cfallin for a review on PR #10821.
saulecabrera requested wasmtime-core-reviewers for a review on PR #10821.
saulecabrera requested alexcrichton for a review on PR #10821.
saulecabrera commented on PR #10821:
I'm running the fuzzer locally. I'll report back later today.
saulecabrera updated PR #10821.
alexcrichton submitted PR review.
alexcrichton merged PR #10821.
Last updated: Dec 06 2025 at 06:05 UTC