Stream: git-wasmtime

Topic: wasmtime / PR #11955 Wasm translator: move stacks into Fu...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2025 at 16:13):

cfallin requested alexcrichton for a review on PR #11955.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2025 at 16:13):

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 FuncTranslationStacks under FuncEnvironment. 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:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2025 at 16:13):

cfallin requested wasmtime-compiler-reviewers for a review on PR #11955.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2025 at 09:45):

cfallin updated PR #11955.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2025 at 14:33):

cfallin updated PR #11955.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 01 2025 at 17:30):

alexcrichton submitted PR review:

Nice! Thanks for pushing on this!

view this post on Zulip Wasmtime GitHub notifications bot (Nov 01 2025 at 18:47):

cfallin merged PR #11955.


Last updated: Dec 06 2025 at 06:05 UTC