Skip to main content

MethodLowering

Enum MethodLowering 

Source
pub enum MethodLowering {
    RuntimeSymbol(RuntimeSymbol),
    Intrinsic(&'static str),
    ScalarPrimitive(RuntimeSymbol),
}
Expand description

How a catalog entry lowers to actual code.

Variants§

§

RuntimeSymbol(RuntimeSymbol)

Lowers to a call into the runtime wrapper named by the ABI manifest, e.g. [RuntimeSymbol::VecPush] (§11.1). Carrying the symbol rather than its name means a catalog row cannot name a wrapper that does not exist, and the row’s allocation/fault behaviour comes from the manifest instead of being restated here.

§

Intrinsic(&'static str)

Lowers to a compiler intrinsic (no runtime symbol). Reserved for the sequence pipeline and a handful of primitives that the compiler folds directly.

§

ScalarPrimitive(RuntimeSymbol)

Lowers to a dedicated MIR instruction whose result is a scalar, with this symbol as the out-of-line form the backend’s cold arm calls (ADR-118 decision 6).

The distinction from RuntimeSymbol is not cosmetic and it is not “this one is inlined”. Two facts follow from it that the plain arm cannot express:

  • The answer is not a GcRef. The row’s manifest return is AbiRet::RawI64, so the wrapper hands back the scalar channel and the builder decides whether the value is ever boxed at all. Every value answer in the plain arm is an AbiRet::Gc, which is what a_non_faulting_row_with_a_value_result_cannot_answer_the_unit_sentinel checks — and the check is right about that arm, which is why this one is a separate variant rather than a loosening of it.
  • The call site’s safepoint status is the instruction’s, not Inst::Call’s. liveness::is_gc_safepoint matches every Inst::Call regardless of the symbol’s Effect, so a Pure primitive lowered as a call spills the whole root set at a point no collection can happen. A row lowered this way gets an instruction MIR can classify honestly.

BitSet.contains is the only row here today. Vec.get/Vec[] want the same treatment and cannot have it yet: their answer is a GcRef element, so they need a Gc-dst instruction rather than a scalar one. See ADR-118’s open questions.

Trait Implementations§

Source§

impl Clone for MethodLowering

Source§

fn clone(&self) -> MethodLowering

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 MethodLowering

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for MethodLowering

Source§

impl PartialEq for MethodLowering

Source§

fn eq(&self, other: &MethodLowering) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MethodLowering

Auto Trait Implementations§

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 = Infallible

The type returned in the event of a conversion error.
Source§

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

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.