Struct cretonne_codegen::ir::stackslot::StackSlots [−][src]
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.
Methods
impl StackSlots
[src]
impl StackSlots
Stack slot manager functions that behave mostly like an entity map.
pub fn new() -> Self
[src]
pub fn new() -> Self
Create an empty stack slot manager.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clear out everything.
pub fn push(&mut self, data: StackSlotData) -> StackSlot
[src]
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.
pub fn is_valid(&self, ss: StackSlot) -> bool
[src]
pub fn is_valid(&self, ss: StackSlot) -> bool
Check if ss
is a valid stack slot reference.
pub fn set_offset(&mut self, ss: StackSlot, offset: StackOffset)
[src]
pub fn set_offset(&mut self, ss: StackSlot, offset: StackOffset)
Set the offset of a stack slot.
ⓘImportant traits for Iter<'a, K, V>pub fn iter(&self) -> Iter<StackSlot, StackSlotData>
[src]
pub fn iter(&self) -> Iter<StackSlot, StackSlotData>
Get an iterator over all the stack slot keys.
ⓘImportant traits for IterMut<'a, K, V>pub fn iter_mut(&mut self) -> IterMut<StackSlot, StackSlotData>
[src]
pub fn iter_mut(&mut self) -> IterMut<StackSlot, StackSlotData>
Get an iterator over all the stack slot keys, mutable edition.
ⓘImportant traits for Iter<'a, T>pub fn values(&self) -> Iter<StackSlotData>
[src]
pub fn values(&self) -> Iter<StackSlotData>
Get an iterator over all the stack slot records.
ⓘImportant traits for IterMut<'a, T>pub fn values_mut(&mut self) -> IterMut<StackSlotData>
[src]
pub fn values_mut(&mut self) -> IterMut<StackSlotData>
Get an iterator over all the stack slot records, mutable edition.
ⓘImportant traits for Keys<K>pub fn keys(&self) -> Keys<StackSlot>
[src]
pub fn keys(&self) -> Keys<StackSlot>
Get an iterator over all the stack slot keys.
pub fn next_key(&self) -> StackSlot
[src]
pub fn next_key(&self) -> StackSlot
Get a reference to the next stack slot that would be created by push()
.
This should just be used by the parser.
impl StackSlots
[src]
impl StackSlots
Higher-level stack frame manipulation functions.
pub fn make_spill_slot(&mut self, ty: Type) -> StackSlot
[src]
pub fn make_spill_slot(&mut self, ty: Type) -> StackSlot
Create a new spill slot for spilling values of type ty
.
pub fn make_incoming_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot
[src]
pub fn make_incoming_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot
Create a stack slot representing an incoming function argument.
pub fn get_outgoing_arg(&mut self, ty: Type, offset: StackOffset) -> StackSlot
[src]
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.
pub fn get_emergency_slot(
&mut self,
ty: Type,
in_use: &[PackedOption<StackSlot>]
) -> StackSlot
[src]
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
impl Clone for StackSlots
[src]
impl Clone for StackSlots
fn clone(&self) -> StackSlots
[src]
fn clone(&self) -> StackSlots
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for StackSlots
[src]
impl Debug for StackSlots
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Index<StackSlot> for StackSlots
[src]
impl Index<StackSlot> for StackSlots
type Output = StackSlotData
The returned type after indexing.
fn index(&self, ss: StackSlot) -> &StackSlotData
[src]
fn index(&self, ss: StackSlot) -> &StackSlotData
Performs the indexing (container[index]
) operation.
impl IndexMut<StackSlot> for StackSlots
[src]
impl IndexMut<StackSlot> for StackSlots
fn index_mut(&mut self, ss: StackSlot) -> &mut StackSlotData
[src]
fn index_mut(&mut self, ss: StackSlot) -> &mut StackSlotData
Performs the mutable indexing (container[index]
) operation.
Auto Trait Implementations
impl Send for StackSlots
impl Send for StackSlots
impl Sync for StackSlots
impl Sync for StackSlots