Skip to main content

Pending

Struct Pending 

Source
pub struct Pending<'a> {
    pub addresses: &'a mut Vec<(Inst, usize)>,
    pub arguments: &'a mut Vec<(Inst, u32)>,
    pub dynamic: &'a mut Vec<Inst>,
}
Expand description

The addresses crate::finish has still to write a displacement into.

Three lists, because the frame holds three kinds of place this pass runs before the layout of: a local’s address is an offset into this function’s own objects, a stack argument’s is an offset into the caller’s area, and a variable length array’s is an offset above wherever the stack pointer ended up. What they have in common is the shape, a lea off the stack pointer with the displacement left at zero, and what this type is for is that folding one of those away has to move the entry rather than lose it.

This used to be a set of instructions the pass refused to touch, and refusing was expensive. Every access to a local through its address was a lea and then a memory instruction reading through the register it wrote, which is one instruction more than it needs, on the shape any function whose locals have their address taken is full of. tamnd/rucc#784.

Fields§

§addresses: &'a mut Vec<(Inst, usize)>

Which instruction carries the address of which of this function’s stack objects.

§arguments: &'a mut Vec<(Inst, u32)>

Which instruction reads which of the arguments the caller passed on the stack.

§dynamic: &'a mut Vec<Inst>

Which instructions carry the address of a local whose size the program worked out.

There is no number beside one of these, because where a variable length array starts is not a place the frame layout hands back: the bytes are already off the stack pointer by the time the address is taken, so what gets written in is how much of the bottom of the frame the arguments of a call keep, which is the same for all of them.

Trait Implementations§

Source§

impl<'a> Debug for Pending<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for Pending<'a>

§

impl<'a> Freeze for Pending<'a>

§

impl<'a> RefUnwindSafe for Pending<'a>

§

impl<'a> Send for Pending<'a>

§

impl<'a> Sync for Pending<'a>

§

impl<'a> Unpin for Pending<'a>

§

impl<'a> UnsafeUnpin for Pending<'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> 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, 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.