Skip to main content

FrameInput

Struct FrameInput 

Source
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: RegSet

The registers the function writes; the callee-saved ones among them are saved and restored.

§has_calls: bool

Whether 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: u32

Bytes of outgoing argument area the function’s calls need (the largest Abi::assign_args result over its calls).

§frame_pointer: bool

Whether to keep a frame pointer.

Trait Implementations§

Source§

impl<'a> Clone for FrameInput<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for FrameInput<'a>

Source§

impl<'a> Debug for FrameInput<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.