Skip to main content

Call

Struct Call 

Source
pub struct Call { /* private fields */ }
Expand description

The registers one call has left.

Made by AbiDescription::call, asked about the return value first and then about each argument in order.

Implementations§

Source§

impl Call

Source

pub const fn abi(&self) -> &'static AbiDescription

The ABI this call follows.

Source

pub const fn integer_left(&self) -> u32

General purpose argument registers left, which is what a test asserts about draining.

Source

pub const fn float_left(&self) -> u32

Floating point argument registers left.

Source

pub fn returns(&mut self, arg: &Arg<'_>) -> Pass

How the return value comes back, which is asked before anything else.

Source

pub fn argument(&mut self, arg: &Arg<'_>) -> Pass

How the next fixed argument travels, which spends whatever registers it takes.

Source

pub fn variadic_argument(&mut self, arg: &Arg<'_>) -> Pass

How the next argument past the ... travels.

Only one of the three policies changes the answer this crate gives. Under Variadic::AlwaysMemory the argument is classified as though no argument registers were left, which is Darwin arm64’s rule stated in the one form that needs no new mechanism. Variadic::BothBanks is a fact about which registers the backend has to write, not about the form the value travels in, so the answer here is the same as for a fixed argument and the description carries the flag for the backend to read.

Source

pub fn in_memory(&self, shape: &Shape<'_>) -> u64

What a fixed argument that travels as Pass::Memory is aligned to in the argument area.

Its own alignment on every ABI but the one that packs the area, and the backend rounds that to a word. Darwin arm64 packs, and there the answer depends on what the aggregate is. A homogeneous floating point aggregate keeps the alignment of its members, so three floats are twelve bytes on a four byte boundary. Anything else is on a word boundary, which is what clang makes of it by passing it as an array of i64, and the backend takes the size rounded up to the alignment, so a record of three chars is one word. An argument past the ... is not packed, so this is not asked about one.

Trait Implementations§

Source§

impl Clone for Call

Source§

fn clone(&self) -> Call

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 Debug for Call

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Call

§

impl RefUnwindSafe for Call

§

impl Send for Call

§

impl Sync for Call

§

impl Unpin for Call

§

impl UnsafeUnpin for Call

§

impl UnwindSafe for Call

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.