Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winch: Prepare for an update to the wasm-tools crates #5238

Merged

Conversation

alexcrichton
Copy link
Member

This commit prepares the winch crate for updating wasm-tools, notably changing a bit about how the visitation of operators works. This moves the function body and wasm validator out of the CodeGen structure and into parameters threaded into the emission of the actual function.

Additionally the VisitOperator implementation was updated to remove the explicit calls to the validator, favoring instead a macro-generated solution to guarantee that all validation happens before any translation proceeds. This means that the VisitOperator for CodeGen impl is now infallible and the various methods have been inlined into the trait methods as well as removing the Result<_>.

Finally this commit updates translation to call validator.finish(..) which is required to perform the final validation steps of the function body.

This commit prepares the `winch` crate for updating `wasm-tools`,
notably changing a bit about how the visitation of operators works. This
moves the function body and wasm validator out of the `CodeGen`
structure and into parameters threaded into the emission of the actual
function.

Additionally the `VisitOperator` implementation was updated to remove
the explicit calls to the validator, favoring instead a macro-generated
solution to guarantee that all validation happens before any translation
proceeds. This means that the `VisitOperator for CodeGen` impl is now
infallible and the various methods have been inlined into the trait
methods as well as removing the `Result<_>`.

Finally this commit updates translation to call `validator.finish(..)`
which is required to perform the final validation steps of the function
body.
Copy link
Member

@saulecabrera saulecabrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the refactoring here! I really like the new signature of the visitors.

@alexcrichton alexcrichton merged commit 3b96685 into bytecodealliance:main Nov 10, 2022
@alexcrichton alexcrichton deleted the prepare-winch-update branch November 10, 2022 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants