pub struct Arrived {
pub regs: Vec<Reg>,
pub stack: Vec<(Inst, u32)>,
pub took: (usize, usize),
pub beyond: u32,
pub spare: Vec<(Reg, RegClass, u32)>,
}Expand description
What a function’s parameters came to.
Fields§
§regs: Vec<Reg>The register each parameter is in, in the order the parameters were given, so the caller can bind each IR parameter to the one at its position.
stack: Vec<(Inst, u32)>The loads that read a parameter out of the caller’s argument area, and how far up that area each of them reads.
Empty for almost every function, because almost every function has few enough parameters to
have been handed all of them in registers. The distance is from the bottom of the caller’s
argument area, which is somewhere crate::finish works out and this cannot.
took: (usize, usize)How many general purpose argument registers the parameters took, and how many vector ones.
Nothing about an ordinary function needs this. A variadic one does: the first argument its
signature does not name is the one after the last it does, so where each of the two walks
stopped is where va_start has to say the next argument begins.
beyond: u32How far up the caller’s argument area the first argument the signature does not name is.
However much of that area the named parameters took, on a convention that counts the two register files apart, because there the area holds only the arguments no register was left for. On one that counts them as one run it is not the same number: that area begins with the shadow space the caller reserved, every argument owns one word of it whether it also arrived in a register or not, and the named ones own the first few of those words. So it is where the walk over the registers stopped, which is a position rather than a size, until the named parameters have used every register and the two agree again.
spare: Vec<(Reg, RegClass, u32)>The argument registers left over for the arguments the signature does not name, as the register each was bound into and how far up the save area its slot is.
Empty unless a save area was asked for. The ones a named parameter took are not here,
because their slots are behind where va_start sets the two offsets and nothing ever reads
them, so writing them would be fourteen stores where six are wanted.