Struct cranelift_codegen::ir::stackslot::StackSlots
source · Expand description
Stack frame manager.
Keep track of all the stack slots used by a function.
Fields§
§frame_size: Option<StackSize>
The total size of the stack frame.
This is the distance from the stack pointer in the current function to the stack pointer in the calling function, so it includes a pushed return address as well as space for outgoing call arguments.
This is computed by the layout()
method.
Implementations§
source§impl StackSlots
impl StackSlots
Stack slot manager functions that behave mostly like an entity map.
sourcepub fn push(&mut self, data: StackSlotData) -> StackSlot
pub fn push(&mut self, data: StackSlotData) -> StackSlot
Allocate a new stack slot.
This function should be primarily used by the text format parser. There are more convenient functions for creating specific kinds of stack slots below.
sourcepub fn set_offset(&mut self, ss: StackSlot, offset: StackOffset)
pub fn set_offset(&mut self, ss: StackSlot, offset: StackOffset)
Set the offset of a stack slot.
sourcepub fn iter(&self) -> Iter<'_, StackSlot, StackSlotData>
pub fn iter(&self) -> Iter<'_, StackSlot, StackSlotData>
Get an iterator over all the stack slot keys.
sourcepub fn iter_mut(&mut self) -> IterMut<'_, StackSlot, StackSlotData>
pub fn iter_mut(&mut self) -> IterMut<'_, StackSlot, StackSlotData>
Get an iterator over all the stack slot keys, mutable edition.
sourcepub fn values(&self) -> Iter<'_, StackSlotData>
pub fn values(&self) -> Iter<'_, StackSlotData>
Get an iterator over all the stack slot records.
sourcepub fn values_mut(&mut self) -> IterMut<'_, StackSlotData>
pub fn values_mut(&mut self) -> IterMut<'_, StackSlotData>
Get an iterator over all the stack slot records, mutable edition.
source§impl StackSlots
impl StackSlots
Higher-level stack frame manipulation functions.
sourcepub fn make_spill_slot(&mut self, ty: Type) -> StackSlot
pub fn make_spill_slot(&mut self, ty: Type) -> StackSlot
Create a new spill slot for spilling values of type ty
.
sourcepub fn make_incoming_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot
pub fn make_incoming_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot
Create a stack slot representing an incoming function argument.
sourcepub fn get_outgoing_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot
pub fn get_outgoing_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot
Get a stack slot representing an outgoing argument.
This may create a new stack slot, or reuse an existing outgoing stack slot with the requested offset and size.
The requested offset is relative to this function’s stack pointer immediately before making the call.
sourcepub fn get_emergency_slot(
&mut self,
ty: Type,
in_use: &[PackedOption<StackSlot>]
) -> StackSlot
pub fn get_emergency_slot(
&mut self,
ty: Type,
in_use: &[PackedOption<StackSlot>]
) -> StackSlot
Get an emergency spill slot that can be used to store a ty
value.
This may allocate a new slot, or it may reuse an existing emergency spill slot, excluding
any slots in the in_use
list.
Trait Implementations§
source§impl Clone for StackSlots
impl Clone for StackSlots
source§fn clone(&self) -> StackSlots
fn clone(&self) -> StackSlots
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more