wasmtime_cranelift

Struct CompiledFunction

source
pub struct CompiledFunction {
    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 CompiledFunction

source

pub fn new( buffer: MachBufferFinalized<Final>, name_map: PrimaryMap<UserExternalNameRef, UserExternalName>, alignment: u32, ) -> Self

Creates a CompiledFunction from a cranelift_codegen::MachBufferFinalized<Final> 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§

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

source§

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>,

source§

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.