pub struct FrameInput<'a> {
pub slots: &'a [SlotKind],
pub written: RegSet,
pub has_calls: bool,
pub outgoing: u32,
pub frame_pointer: bool,
}Expand description
Everything about a function the frame depends on.
Function::frame_layout fills this
in from a function; build one by hand to lay out a frame for code that is
not MIR.
§Examples
use backend_lang::RegSet;
use backend_lang::mir::SlotKind;
use backend_lang::target::frame::FrameInput;
use backend_lang::x86_64::{SYSV, RBX};
let slots = [SlotKind::Local { size: 8, align: 8 }];
let input = FrameInput {
slots: &slots,
written: RegSet::of(&[RBX]),
has_calls: true,
outgoing: 0,
frame_pointer: true,
};
let frame = SYSV.layout_frame(&input)?;
assert_eq!(frame.pushed(), [RBX]);Fields§
§slots: &'a [SlotKind]The function’s stack slots, indexed by StackSlot::index.
written: RegSetThe registers the function writes; the callee-saved ones among them are saved and restored.
has_calls: boolWhether the function calls anything (then the stack is 16-aligned at each call, the red zone is off, and Win64 shadow space is reserved).
outgoing: u32Bytes of outgoing argument area the function’s calls need (the
largest Abi::assign_args result over its calls).
frame_pointer: boolWhether to keep a frame pointer.
Trait Implementations§
Source§impl<'a> Clone for FrameInput<'a>
impl<'a> Clone for FrameInput<'a>
impl<'a> Copy for FrameInput<'a>
Auto Trait Implementations§
impl<'a> Freeze for FrameInput<'a>
impl<'a> RefUnwindSafe for FrameInput<'a>
impl<'a> Send for FrameInput<'a>
impl<'a> Sync for FrameInput<'a>
impl<'a> Unpin for FrameInput<'a>
impl<'a> UnsafeUnpin for FrameInput<'a>
impl<'a> UnwindSafe for FrameInput<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more