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]

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]

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]

Store to a stackslot.

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]

Load from a spillslot.

fn store_spillslot(
    &self,
    slot: SpillSlot,
    ty: Type,
    from_regs: ValueRegs<Reg>
) -> SmallInstVec<Self::I>
[src]

Store to a spillslot.

type I = M::I

The instruction type for the ISA associated with this ABI.

fn signature(&self) -> &Signature[src]

Access the (possibly legalized) signature.

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]

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]

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 flags(&self) -> &Flags[src]

Get the settings controlling this function’s compilation.

fn call_conv(&self) -> CallConv[src]

Get the calling convention implemented by this ABI object.

fn liveins(&self) -> Set<RealReg>[src]

Get the liveins of the function.

fn liveouts(&self) -> Set<RealReg>[src]

Get the liveouts of the function.

fn num_args(&self) -> usize[src]

Number of arguments.

fn num_retvals(&self) -> usize[src]

Number of return values.

fn num_stackslots(&self) -> usize[src]

Number of stack slots (not spill slots).

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]

Generate an instruction which copies an argument to a destination register. Read more

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]

Generate an instruction which copies a source register to a return value slot.

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_ret(&self) -> Self::I[src]

Generate a return instruction.

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]

Update with the number of spillslots, post-regalloc.

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]

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]

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]

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]

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]

Returns the size of arguments expected on the stack.

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]

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

fn gen_reload(
    &self,
    to_reg: Writable<RealReg>,
    from_slot: SpillSlot,
    ty: Option<Type>
) -> Self::I
[src]

Generate a reload (fill). As for spills, the type may be given to allow a more optimized load instruction to be generated. Read more

Auto Trait Implementations

impl<M> RefUnwindSafe for ABICalleeImpl<M> where
    M: RefUnwindSafe,
    <M as ABIMachineSpec>::I: RefUnwindSafe

impl<M> Send for ABICalleeImpl<M> where
    M: Send,
    <M as ABIMachineSpec>::I: Send

impl<M> Sync for ABICalleeImpl<M> where
    M: Sync,
    <M as ABIMachineSpec>::I: Sync

impl<M> Unpin for ABICalleeImpl<M> where
    M: Unpin,
    <M as ABIMachineSpec>::I: Unpin

impl<M> UnwindSafe for ABICalleeImpl<M> where
    M: UnwindSafe,
    <M as ABIMachineSpec>::I: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.