Trait wasmtime_environ::wasm::TargetEnvironment[][src]

pub trait TargetEnvironment {
    pub fn target_config(&self) -> TargetFrontendConfig;

    pub fn pointer_type(&self) -> Type { ... }
pub fn pointer_bytes(&self) -> u8 { ... }
pub fn reference_type(&self, ty: WasmType) -> Type { ... } }

Environment affecting the translation of a WebAssembly.

Required methods

pub fn target_config(&self) -> TargetFrontendConfig[src]

Get the information needed to produce Cranelift IR for the given target.

Loading content...

Provided methods

pub fn pointer_type(&self) -> Type[src]

Get the Cranelift integer type to use for native pointers.

This returns I64 for 64-bit architectures and I32 for 32-bit architectures.

pub fn pointer_bytes(&self) -> u8[src]

Get the size of a native pointer, in bytes.

pub fn reference_type(&self, ty: WasmType) -> Type[src]

Get the Cranelift reference type to use for the given Wasm reference type.

By default, this returns R64 for 64-bit architectures and R32 for 32-bit architectures. If you override this, then you should also override FuncEnvironment::{translate_ref_null, translate_ref_is_null} as well.

Loading content...

Implementors

Loading content...