pub struct Frame { /* private fields */ }Expand description
What a function’s stack looks like while it runs.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn of(func: &Func, allocation: &Allocation, layout: &Layout<'_>) -> Self
pub fn of(func: &Func, allocation: &Allocation, layout: &Layout<'_>) -> Self
Works out the frame of a function the allocator has finished with.
§Panics
Panics on a frame of two gigabytes or more, which is a stack no machine here gives a thread, and on a local whose alignment is not a power of two.
Sourcepub fn saved_int(&self) -> &[PhysReg]
pub fn saved_int(&self) -> &[PhysReg]
The general purpose registers the prologue pushes, in the order it pushes them.
The frame pointer is not among them even when the convention calls it a saved register, because a function that keeps one saves it as part of setting it up.
Sourcepub fn saved_sse(&self) -> &[PhysReg]
pub fn saved_sse(&self) -> &[PhysReg]
The vector registers the prologue stores into the frame, in the order it stores them.
Sourcepub fn slot(&self, slot: u32) -> Option<i32>
pub fn slot(&self, slot: u32) -> Option<i32>
Where a spill slot is, from the stack pointer in the body of the function.
Sourcepub fn local(&self, local: usize) -> Option<i32>
pub fn local(&self, local: usize) -> Option<i32>
Where a local is, from the stack pointer in the body of the function.
Sourcepub fn size(&self) -> u32
pub fn size(&self) -> u32
How many bytes the prologue takes off the stack pointer, which is nothing for a function small enough and quiet enough to live in the red zone.
Sourcepub fn outgoing(&self) -> u32
pub fn outgoing(&self) -> u32
How many bytes at the bottom of the frame belong to the arguments of calls this function makes, which is where the shadow space goes on Windows.
Sourcepub fn realign(&self) -> Option<u32>
pub fn realign(&self) -> Option<u32>
What the prologue has to force the stack pointer to be a multiple of, when a local wants more alignment than a call leaves it with.
Sourcepub fn incoming(&self) -> Option<i32>
pub fn incoming(&self) -> Option<i32>
Where the first argument the caller passed on the stack is, from the stack pointer in the body of the function.
A realigned frame answers that it does not know, because forcing the alignment threw away however far the caller’s stack pointer was from where the prologue wanted it, and the frame pointer is what reaches the caller’s stack afterwards.
Sourcepub fn frame_pointer(&self) -> bool
pub fn frame_pointer(&self) -> bool
Whether the function keeps a frame pointer.