Stream: git-wasmtime

Topic: wasmtime / PR #6017 winch: Introduce `winch-environ`


view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 17:14):

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 the winch_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 the VMContext.

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.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 17:15):

saulecabrera requested cfallin for a review on PR #6017.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 17:16):

saulecabrera updated PR #6017 from winch-environ to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 17:39):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 17:39):

cfallin created PR review comment:

Is this the same as the index that is passed into callee_from_index? Can we document that if so (something like "The callee index in the Wasm function index space")?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 17:39):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 17:39):

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()?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 18:48):

saulecabrera updated PR #6017 from winch-environ to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 18:49):

saulecabrera submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 18:49):

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!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 18:49):

saulecabrera submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 18:49):

saulecabrera created PR review comment:

Good catch -- opted to use unwrap_or_else(|| ...)

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 19:36):

saulecabrera updated PR #6017 from winch-environ to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 19:44):

saulecabrera has enabled auto merge for PR #6017.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2023 at 20:44):

saulecabrera merged PR #6017.


Last updated: Dec 23 2024 at 12:05 UTC