forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate translation of wasmfx instructions in FuncEnvironment (by…
…tecodealliance#152) This is just a minor cleanup, influencing where different parts of translating wasmfx instructions happens. For `resume` instructions, at some point we moved all of the translation logic out of `code_translator.rs` and into `func_environ.rs`. This means that the `Operator::Resume` case in `translate_operator` only manipulates the value stack, and then delegates the actual translation to `translate_resume` in `FuncEnvironment` (which then in turn delegates to the corresponding translation functions in the baseline or optimized implementation). This PR does the same for `cont.bind`, `cont.new`, and `suspend`, where some of the translation logic was scattered between `code_translator.rs` and `func_environ.rs`. The previous situation had the downside of requiring a bunch of `typed_continuations_*` functions (e.g., `typed_continuations_store_payloads`) to be part of the interface of `FuncEnvironment`, and then both the baseline and optimized implementation had to implement that same interface. This created some unnecessary coupling between the two implementations. After these changes, the case for any wasmfx instruction `foo` in `code_translator.rs` only manipulates the value stack, and then calls `translate_foo` in `FuncEnvironment`, which then calls `translate_foo` in the baseline or optimized implementation. In particular, no `typed_continuations_*` functions are required in the `FuncEnvironment` trait itself anymore.
- Loading branch information
1 parent
ab7a37c
commit 6b66235
Showing
5 changed files
with
97 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.