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 isAbiRet::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 anAbiRet::Gc, which is whata_non_faulting_row_with_a_value_result_cannot_answer_the_unit_sentinelchecks — 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_safepointmatches everyInst::Callregardless of the symbol’sEffect, so aPureprimitive 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
impl Clone for MethodLowering
Source§fn clone(&self) -> MethodLowering
fn clone(&self) -> MethodLowering
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more