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: u32Word size in bytes, so this struct can be
monomorphic/independent of ABIMachineSpec.
incoming_args_size: u32N.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: u32The 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: u32Size 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: u32Size 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: u32Storage allocated for the fixed part of the stack frame. This contains stack slots and spill slots.
stackslots_size: u32The size of all stackslots.
outgoing_args_size: u32Stack 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: FunctionCallsThe function’s call pattern classification.
Implementations§
Source§impl FrameLayout
impl FrameLayout
Sourcepub fn clobbered_callee_saves_by_class(
&self,
) -> (&[Writable<RealReg>], &[Writable<RealReg>])
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.
Sourcepub fn active_size(&self) -> u32
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).
Sourcepub fn sp_to_sized_stack_slots(&self) -> u32
pub fn sp_to_sized_stack_slots(&self) -> u32
Get the offset from the SP to the sized stack slots area.
Sourcepub fn spillslot_offset(&self, spillslot: SpillSlot) -> i64
pub fn spillslot_offset(&self, spillslot: SpillSlot) -> i64
Get the offset of a spill slot from SP.
Trait Implementations§
Source§impl Clone for FrameLayout
impl Clone for FrameLayout
Source§fn clone(&self) -> FrameLayout
fn clone(&self) -> FrameLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more