Struct winch_codegen::FuncEnv

source ·
pub struct FuncEnv<'a, P> {
    pub vmoffsets: VMOffsets<P>,
    pub translation: &'a ModuleTranslation<'a>,
}
Expand description

The function environment.

Contains all information about the module and runtime that is accessible to to a particular function during code generation.

Fields§

§vmoffsets: VMOffsets<P>

Offsets to the fields within the VMContext ptr.

§translation: &'a ModuleTranslation<'a>

Metadata about the translation process of a WebAssembly module.

Implementations§

source§

impl<'a, P: PtrSize> FuncEnv<'a, P>

source

pub fn new(ptr: P, translation: &'a ModuleTranslation<'_>) -> Self

Create a new function environment.

source

pub fn callee_from_index(&self, idx: FuncIndex) -> Callee

Resolves a function [Callee] from an index.

source

pub fn resolve_block_type(&self, blockty: BlockType) -> SmallVec<[WasmType; 1]>

Resolves the type of the block in terms of [wasmtime_environ::WasmType].

source

pub fn resolve_global_type_and_offset( &self, index: GlobalIndex ) -> (WasmType, u32)

Resolves the type and offset of a global at the given index.

Auto Trait Implementations§

§

impl<'a, P> RefUnwindSafe for FuncEnv<'a, P>where P: RefUnwindSafe,

§

impl<'a, P> Send for FuncEnv<'a, P>where P: Send,

§

impl<'a, P> Sync for FuncEnv<'a, P>where P: Sync,

§

impl<'a, P> Unpin for FuncEnv<'a, P>where P: Unpin,

§

impl<'a, P> UnwindSafe for FuncEnv<'a, P>where P: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.