Struct cranelift_codegen::machinst::abi_impl::ABICalleeImpl [−][src]
pub struct ABICalleeImpl<M: ABIMachineSpec> { /* fields omitted */ }
Expand description
ABI object for a function body.
Implementations
impl<M: ABIMachineSpec> ABICalleeImpl<M>[src]
impl<M: ABIMachineSpec> ABICalleeImpl<M>[src]pub fn new(f: &Function, flags: Flags) -> CodegenResult<Self>[src]
pub fn new(f: &Function, flags: Flags) -> CodegenResult<Self>[src]Create a new body ABI instance.
Trait Implementations
impl<M: ABIMachineSpec> ABICallee for ABICalleeImpl<M>[src]
impl<M: ABIMachineSpec> ABICallee for ABICalleeImpl<M>[src]fn load_stackslot(
&self,
slot: StackSlot,
offset: u32,
ty: Type,
into_regs: ValueRegs<Writable<Reg>>
) -> SmallInstVec<Self::I>[src]
fn load_stackslot(
&self,
slot: StackSlot,
offset: u32,
ty: Type,
into_regs: ValueRegs<Writable<Reg>>
) -> SmallInstVec<Self::I>[src]Load from a stackslot.
fn store_stackslot(
&self,
slot: StackSlot,
offset: u32,
ty: Type,
from_regs: ValueRegs<Reg>
) -> SmallInstVec<Self::I>[src]
fn store_stackslot(
&self,
slot: StackSlot,
offset: u32,
ty: Type,
from_regs: ValueRegs<Reg>
) -> SmallInstVec<Self::I>[src]Store to a stackslot.
fn stackslot_addr(
&self,
slot: StackSlot,
offset: u32,
into_reg: Writable<Reg>
) -> Self::I[src]
fn stackslot_addr(
&self,
slot: StackSlot,
offset: u32,
into_reg: Writable<Reg>
) -> Self::I[src]Produce an instruction that computes a stackslot address.
fn load_spillslot(
&self,
slot: SpillSlot,
ty: Type,
into_regs: ValueRegs<Writable<Reg>>
) -> SmallInstVec<Self::I>[src]
fn load_spillslot(
&self,
slot: SpillSlot,
ty: Type,
into_regs: ValueRegs<Writable<Reg>>
) -> SmallInstVec<Self::I>[src]Load from a spillslot.
fn store_spillslot(
&self,
slot: SpillSlot,
ty: Type,
from_regs: ValueRegs<Reg>
) -> SmallInstVec<Self::I>[src]
fn store_spillslot(
&self,
slot: SpillSlot,
ty: Type,
from_regs: ValueRegs<Reg>
) -> SmallInstVec<Self::I>[src]Store to a spillslot.
fn temp_needed(&self) -> Option<Type>[src]
fn temp_needed(&self) -> Option<Type>[src]Does the ABI-body code need a temp reg (and if so, of what type)? One
will be provided to init() as the maybe_tmp arg if so. Read more
fn init(&mut self, maybe_tmp: Option<Writable<Reg>>)[src]
fn init(&mut self, maybe_tmp: Option<Writable<Reg>>)[src]Initialize. This is called after the ABICallee is constructed because it may be provided with a temp vreg, which can only be allocated once the lowering context exists. Read more
fn accumulate_outgoing_args_size(&mut self, size: u32)[src]
fn accumulate_outgoing_args_size(&mut self, size: u32)[src]Accumulate outgoing arguments. This ensures that at least SIZE bytes are allocated in the prologue to be available for use in function calls to hold arguments and/or return values. If this function is called multiple times, the maximum of all SIZE values will be available. Read more
fn num_retvals(&self) -> usize[src]
fn num_retvals(&self) -> usize[src]Number of return values.
fn num_stackslots(&self) -> usize[src]
fn num_stackslots(&self) -> usize[src]Number of stack slots (not spill slots).
fn stackslot_offsets(&self) -> &PrimaryMap<StackSlot, u32>[src]
fn stackslot_offsets(&self) -> &PrimaryMap<StackSlot, u32>[src]The offsets of all stack slots (not spill slots) for debuginfo purposes.
fn gen_copy_arg_to_regs(
&self,
idx: usize,
into_regs: ValueRegs<Writable<Reg>>
) -> SmallInstVec<Self::I>[src]
fn gen_copy_arg_to_regs(
&self,
idx: usize,
into_regs: ValueRegs<Writable<Reg>>
) -> SmallInstVec<Self::I>[src]Generate an instruction which copies an argument to a destination register. Read more
fn arg_is_needed_in_body(&self, idx: usize) -> bool[src]
fn arg_is_needed_in_body(&self, idx: usize) -> bool[src]Is the given argument needed in the body (as opposed to, e.g., serving only as a special ABI-specific placeholder)? This controls whether lowering will copy it to a virtual reg use by CLIF instructions. Read more
fn gen_copy_regs_to_retval(
&self,
idx: usize,
from_regs: ValueRegs<Writable<Reg>>
) -> SmallInstVec<Self::I>[src]
fn gen_copy_regs_to_retval(
&self,
idx: usize,
from_regs: ValueRegs<Writable<Reg>>
) -> SmallInstVec<Self::I>[src]Generate an instruction which copies a source register to a return value slot.
fn gen_retval_area_setup(&self) -> Option<Self::I>[src]
fn gen_retval_area_setup(&self) -> Option<Self::I>[src]Generate any setup instruction needed to save values to the return-value area. This is usually used when were are multiple return values or an otherwise large return value that must be passed on the stack; typically the ABI specifies an extra hidden argument that is a pointer to that memory. Read more
fn gen_epilogue_placeholder(&self) -> Self::I[src]
fn gen_epilogue_placeholder(&self) -> Self::I[src]Generate an epilogue placeholder. The returned instruction should return true from
is_epilogue_placeholder(); this is used to indicate to the lowering driver when
the epilogue should be inserted. Read more
fn set_num_spillslots(&mut self, slots: usize)[src]
fn set_num_spillslots(&mut self, slots: usize)[src]Update with the number of spillslots, post-regalloc.
fn set_clobbered(&mut self, clobbered: Set<Writable<RealReg>>)[src]
fn set_clobbered(&mut self, clobbered: Set<Writable<RealReg>>)[src]Update with the clobbered registers, post-regalloc.
fn spillslots_to_stack_map(
&self,
slots: &[SpillSlot],
state: &<Self::I as MachInstEmit>::State
) -> StackMap[src]
fn spillslots_to_stack_map(
&self,
slots: &[SpillSlot],
state: &<Self::I as MachInstEmit>::State
) -> StackMap[src]Generate a stack map, given a list of spillslots and the emission state at a given program point (prior to emission fo the safepointing instruction). Read more
fn gen_prologue(&mut self) -> SmallInstVec<Self::I>[src]
fn gen_prologue(&mut self) -> SmallInstVec<Self::I>[src]Generate a prologue, post-regalloc. This should include any stack
frame or other setup necessary to use the other methods (load_arg,
store_retval, and spillslot accesses.) self is mutable so that we
can store information in it which will be useful when creating the
epilogue. Read more
fn gen_epilogue(&self) -> SmallInstVec<M::I>[src]
fn gen_epilogue(&self) -> SmallInstVec<M::I>[src]Generate an epilogue, post-regalloc. Note that this must generate the actual return instruction (rather than emitting this in the lowering logic), because the epilogue code comes before the return and the two are likely closely related. Read more
fn frame_size(&self) -> u32[src]
fn frame_size(&self) -> u32[src]Returns the full frame size for the given function, after prologue emission has run. This comprises the spill slots and stack-storage slots (but not storage for clobbered callee-save registers, arguments pushed at callsites within this function, or other ephemeral pushes). This is used for ABI variants where the client generates prologue/epilogue code, as in Baldrdash (SpiderMonkey integration). Read more
fn stack_args_size(&self) -> u32[src]
fn stack_args_size(&self) -> u32[src]Returns the size of arguments expected on the stack.
fn get_spillslot_size(&self, rc: RegClass, ty: Type) -> u32[src]
fn get_spillslot_size(&self, rc: RegClass, ty: Type) -> u32[src]Get the spill-slot size.
fn gen_spill(
&self,
to_slot: SpillSlot,
from_reg: RealReg,
ty: Option<Type>
) -> Self::I[src]
fn gen_spill(
&self,
to_slot: SpillSlot,
from_reg: RealReg,
ty: Option<Type>
) -> Self::I[src]Generate a spill. The type, if known, is given; this can be used to generate a store instruction optimized for the particular type rather than the RegClass (e.g., only F64 that resides in a V128 register). If no type is given, the implementation should spill the whole register. Read more
Auto Trait Implementations
impl<M> RefUnwindSafe for ABICalleeImpl<M> where
M: RefUnwindSafe,
<M as ABIMachineSpec>::I: RefUnwindSafe,
M: RefUnwindSafe,
<M as ABIMachineSpec>::I: RefUnwindSafe,
impl<M> Send for ABICalleeImpl<M> where
M: Send,
<M as ABIMachineSpec>::I: Send,
M: Send,
<M as ABIMachineSpec>::I: Send,
impl<M> Sync for ABICalleeImpl<M> where
M: Sync,
<M as ABIMachineSpec>::I: Sync,
M: Sync,
<M as ABIMachineSpec>::I: Sync,
impl<M> Unpin for ABICalleeImpl<M> where
M: Unpin,
<M as ABIMachineSpec>::I: Unpin,
M: Unpin,
<M as ABIMachineSpec>::I: Unpin,
impl<M> UnwindSafe for ABICalleeImpl<M> where
M: UnwindSafe,
<M as ABIMachineSpec>::I: RefUnwindSafe + UnwindSafe,
M: UnwindSafe,
<M as ABIMachineSpec>::I: RefUnwindSafe + UnwindSafe,