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
impl CompiledFunction
sourcepub fn new(
buffer: MachBufferFinalized<Final>,
name_map: PrimaryMap<UserExternalNameRef, UserExternalName>,
alignment: u32,
) -> Self
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.
sourcepub fn relocations(&self) -> impl Iterator<Item = Relocation> + '_
pub fn relocations(&self) -> impl Iterator<Item = Relocation> + '_
Returns an iterator to the function’s relocation information.
sourcepub fn traps(&self) -> impl Iterator<Item = TrapInformation> + '_
pub fn traps(&self) -> impl Iterator<Item = TrapInformation> + '_
Returns an iterator to the function’s trap information.
sourcepub fn address_map(&self) -> &FunctionAddressMap
pub fn address_map(&self) -> &FunctionAddressMap
Get the function’s address map from the metadata.
sourcepub fn set_address_map(
&mut self,
offset: u32,
length: u32,
with_instruction_addresses: bool,
)
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.
sourcepub fn unwind_info(&self) -> Option<&UnwindInfo>
pub fn unwind_info(&self) -> Option<&UnwindInfo>
Get a reference to the unwind information from the function’s metadata.
sourcepub fn metadata(&self) -> &CompiledFunctionMetadata
pub fn metadata(&self) -> &CompiledFunctionMetadata
Get a reference to the compiled function metadata.
sourcepub fn set_value_labels_ranges(&mut self, ranges: ValueLabelsRanges)
pub fn set_value_labels_ranges(&mut self, ranges: ValueLabelsRanges)
Set the value labels ranges in the function’s metadata.
sourcepub fn set_unwind_info(&mut self, unwind: UnwindInfo)
pub fn set_unwind_info(&mut self, unwind: UnwindInfo)
Set the unwind info in the function’s metadata.
sourcepub fn set_cfa_unwind_info(&mut self, unwind: CfaUnwindInfo)
pub fn set_cfa_unwind_info(&mut self, unwind: CfaUnwindInfo)
Set the CFA-based unwind info in the function’s metadata.
sourcepub fn set_sized_stack_slots(&mut self, slots: StackSlots)
pub fn set_sized_stack_slots(&mut self, slots: StackSlots)
Set the sized stack slots.
Auto Trait Implementations§
impl Freeze for CompiledFunction
impl RefUnwindSafe for CompiledFunction
impl Send for CompiledFunction
impl Sync for CompiledFunction
impl Unpin for CompiledFunction
impl UnwindSafe for CompiledFunction
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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