Struct wasmtime_cranelift_shared::CompiledFunction

source ·
pub struct CompiledFunction<E: CompiledFuncEnv> {
    pub buffer: MachBufferFinalized<Final>,
    pub alignment: u32,
    /* private fields */
}
Expand description

Compiled function: machine code body, jump table offsets, and unwind information.

Fields§

§buffer: MachBufferFinalized<Final>

The machine code buffer for this function.

§alignment: u32

The alignment for the compiled function.

Implementations§

source§

impl<E> CompiledFunction<E>
where E: CompiledFuncEnv,

source

pub fn new(buffer: MachBufferFinalized<Final>, env: E, alignment: u32) -> Self

Creates a CompiledFunction from a cranelift_codegen::MachBufferFinalized This function uses the information in the machine buffer to derive the traps and relocations fields. The compiled function metadata is loaded with the default values.

source

pub fn relocations(&self) -> impl Iterator<Item = Relocation> + '_

Returns an iterator to the function’s relocation information.

source

pub fn traps(&self) -> impl Iterator<Item = TrapInformation> + '_

Returns an iterator to the function’s trap information.

source

pub fn address_map(&self) -> &FunctionAddressMap

Get the function’s address map from the metadata.

source

pub fn set_address_map( &mut self, offset: u32, length: u32, with_instruction_addresses: bool )

Create and return the compiled function address map from the original source offset and length.

source

pub fn unwind_info(&self) -> Option<&UnwindInfo>

Get a reference to the unwind information from the function’s metadata.

source

pub fn metadata(&self) -> &CompiledFunctionMetadata

Get a reference to the compiled function metadata.

source

pub fn set_value_labels_ranges(&mut self, ranges: ValueLabelsRanges)

Set the value labels ranges in the function’s metadata.

source

pub fn set_unwind_info(&mut self, unwind: UnwindInfo)

Set the unwind info in the function’s metadata.

source

pub fn set_cfa_unwind_info(&mut self, unwind: CfaUnwindInfo)

Set the CFA-based unwind info in the function’s metadata.

source

pub fn set_sized_stack_slots(&mut self, slots: StackSlots)

Set the sized stack slots.

Auto Trait Implementations§

§

impl<E> Freeze for CompiledFunction<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for CompiledFunction<E>
where E: RefUnwindSafe,

§

impl<E> Send for CompiledFunction<E>
where E: Send,

§

impl<E> Sync for CompiledFunction<E>
where E: Sync,

§

impl<E> Unpin for CompiledFunction<E>
where E: Unpin,

§

impl<E> UnwindSafe for CompiledFunction<E>
where E: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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.