Skip to main content

FrameLayout

Struct FrameLayout 

Source
pub struct FrameLayout {
    pub word_bytes: u32,
    pub incoming_args_size: u32,
    pub tail_args_size: u32,
    pub setup_area_size: u32,
    pub clobber_size: u32,
    pub fixed_frame_storage_size: u32,
    pub stackslots_size: u32,
    pub outgoing_args_size: u32,
    pub clobbered_callee_saves: Vec<Writable<RealReg>>,
    pub function_calls: FunctionCalls,
}
Expand description

Structure describing the layout of a function’s stack frame.

Fields§

§word_bytes: u32

Word size in bytes, so this struct can be monomorphic/independent of ABIMachineSpec.

§incoming_args_size: u32

N.B. The areas whose sizes are given in this structure fully cover the current function’s stack frame, from high to low stack addresses in the sequence below. Each size contains any alignment padding that may be required by the ABI. Size of incoming arguments on the stack. This is not technically part of this function’s frame, but code in the function will still need to access it. Depending on the ABI, we may need to set up a frame pointer to do so; we also may need to pop this area from the stack upon return.

§tail_args_size: u32

The size of the incoming argument area, taking into account any potential increase in size required for tail calls present in the function. In the case that no tail calls are present, this value will be the same as Self::incoming_args_size.

§setup_area_size: u32

Size of the “setup area”, typically holding the return address and/or the saved frame pointer. This may be written either during the call itself (e.g. a pushed return address) or by code emitted from gen_prologue_frame_setup. In any case, after that code has completed execution, the stack pointer is expected to point to the bottom of this area. The same holds at the start of code emitted by gen_epilogue_frame_restore.

§clobber_size: u32

Size of the area used to save callee-saved clobbered registers. This area is accessed by code emitted from gen_clobber_save and gen_clobber_restore.

§fixed_frame_storage_size: u32

Storage allocated for the fixed part of the stack frame. This contains stack slots and spill slots.

§stackslots_size: u32

The size of all stackslots.

§outgoing_args_size: u32

Stack size to be reserved for outgoing arguments, if used by the current ABI, or 0 otherwise. After gen_clobber_save and before gen_clobber_restore, the stack pointer points to the bottom of this area.

§clobbered_callee_saves: Vec<Writable<RealReg>>

Sorted list of callee-saved registers that are clobbered according to the ABI. These registers will be saved and restored by gen_clobber_save and gen_clobber_restore.

§function_calls: FunctionCalls

The function’s call pattern classification.

Implementations§

Source§

impl FrameLayout

Source

pub fn clobbered_callee_saves_by_class( &self, ) -> (&[Writable<RealReg>], &[Writable<RealReg>])

Split the clobbered callee-save registers into integer-class and float-class groups.

This method does not currently support vector-class callee-save registers because no current backend has them.

Source

pub fn active_size(&self) -> u32

The size of FP to SP while the frame is active (not during prologue setup or epilogue tear down).

Source

pub fn sp_to_sized_stack_slots(&self) -> u32

Get the offset from the SP to the sized stack slots area.

Source

pub fn spillslot_offset(&self, spillslot: SpillSlot) -> i64

Get the offset of a spill slot from SP.

Source

pub fn sp_to_fp(&self) -> u32

Get the offset from SP up to FP.

Trait Implementations§

Source§

impl Clone for FrameLayout

Source§

fn clone(&self) -> FrameLayout

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FrameLayout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FrameLayout

Source§

fn default() -> FrameLayout

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.