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>
impl<'a, P: PtrSize> FuncEnv<'a, P>
sourcepub fn new(ptr: P, translation: &'a ModuleTranslation<'_>) -> Self
pub fn new(ptr: P, translation: &'a ModuleTranslation<'_>) -> Self
Create a new function environment.
sourcepub fn callee_from_index(&self, idx: FuncIndex) -> Callee
pub fn callee_from_index(&self, idx: FuncIndex) -> Callee
Resolves a function [Callee
] from an index.
sourcepub fn resolve_block_type(&self, blockty: BlockType) -> SmallVec<[WasmType; 1]>
pub fn resolve_block_type(&self, blockty: BlockType) -> SmallVec<[WasmType; 1]>
Resolves the type of the block in terms of [wasmtime_environ::WasmType
].
sourcepub fn resolve_global_type_and_offset(
&self,
index: GlobalIndex
) -> (WasmType, u32)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more