saulecabrera opened PR #6017 from winch-environ
to main
:
This commit introduces the
winch-environ
crate. This crate's responsibility is
to provide a shared implementatation of thewinch_codegen::FuncEnv
trait,
which is Winch's function compilation environment, used to resolve module and
runtime specific information needed by the code generation, such as resolving
all the details about a callee in a WebAssembly module, or resolving specific
information from theVMContext
.As of this change, the implementation only includes the necessary pieces to
resolve a function callee in a WebAssembly module. The idea is to evolve the
winch_codegen::FuncEnv
trait as we evolve Winch's code generation.
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
saulecabrera requested cfallin for a review on PR #6017.
saulecabrera updated PR #6017 from winch-environ
to main
.
cfallin submitted PR review.
cfallin created PR review comment:
Is this the same as the
index
that is passed intocallee_from_index
? Can we document that if so (something like "The callee index in the Wasm function index space")?
cfallin submitted PR review.
cfallin created PR review comment:
A little efficiency thing: this will always invoke
format!
and allocate the string, even in the happy path; I think maybe a better option here is.unwrap_or_else(|| panic!(...))
or.ok_or_else(|| format!(...)).unwrap()
?
saulecabrera updated PR #6017 from winch-environ
to main
.
saulecabrera submitted PR review.
saulecabrera created PR review comment:
Agreed and yeah it's the same index -- I'm returning it as part of the
Callee
for convenience.Fixed!
saulecabrera submitted PR review.
saulecabrera created PR review comment:
Good catch -- opted to use
unwrap_or_else(|| ...)
saulecabrera updated PR #6017 from winch-environ
to main
.
saulecabrera has enabled auto merge for PR #6017.
saulecabrera merged PR #6017.
Last updated: Nov 22 2024 at 16:03 UTC