saulecabrera requested abrown for a review on PR #9708.
saulecabrera requested wasmtime-compiler-reviewers for a review on PR #9708.
saulecabrera opened PR #9708 from saulecabrera:improve-local-management
to bytecodealliance:main
:
This commit addresses issues identified while working on issue #8091. It improves the frame handling in Winch to prevent subtle bugs and enhance the robustness of the code generation process.
Previously, there was no clear mechanism to verify when the frame was fully set up and safe to access the local slots allocated for register arguments, including the special slots used for the
VMContext
. As a result, it was possible to inadvertently read from uninitialized memory if calls were made before the frame was properly set up and sealed.This commit introduces two main changes with the objective to help reduce the risk of introducing bugs related to the above:
A
CodeGenPhase
trait, used via the type state pattern to clearly gate the operations allowed during each phase of the code generation process.Improve the semantics of locals, by clearly separating the notion of Wasm locals and special locals used by the compiler. This specialization allows a more accurate representation of the semantics of Wasm locals and their index space.
<!--
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
-->
github-actions[bot] commented on PR #9708:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
abrown submitted PR review:
Makes sense; sorry for missing this review earlier.
saulecabrera updated PR #9708.
saulecabrera commented on PR #9708:
Thanks for the review @abrown -- and no worries!
saulecabrera has enabled auto merge for PR #9708.
saulecabrera merged PR #9708.
Last updated: Dec 23 2024 at 12:05 UTC