cfallin requested alexcrichton for a review on PR #11955.
cfallin opened PR #11955 from cfallin:refactor-wasm-translator-stacks to bytecodealliance:main:
This is a refactor that came up [here]: we currently have a split between the "environment" and the "stacks" in the Wasm translator that is mostly a path-dependent property from our development history: the environment used to be a trait purely with hook implementations. It turns out that carrying through the multiple bits was becoming fairly verbose plumbing and it is desired to collapse it somewhat.
This PR puts
FuncTranslationStacksunderFuncEnvironment. As a result, all of our Wasmtime-specific state is now in one container that we can plumb through more easily.There is a tiny bit more cloning here: calls and a few other instructions were peeking a slice of the operand stack and passing that into a method on the environ (taking a mut self) to codegen certain sequences. An alternative would have been to indirect somehow -- pass a
Range<usize>or a closure that gets the environ back to yield the args slice -- but it didn't seem worth the complexity here. Happy to change if needed.[here]: https://github.com/bytecodealliance/wasmtime/pull/11921#discussion_r2461912848
<!--
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
-->
cfallin requested wasmtime-compiler-reviewers for a review on PR #11955.
cfallin updated PR #11955.
cfallin updated PR #11955.
alexcrichton submitted PR review:
Nice! Thanks for pushing on this!
cfallin merged PR #11955.
Last updated: Dec 06 2025 at 06:05 UTC