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.