Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Produce a stable fingerprint of the parts of the enclosing call-site state that a cached helper's RHS captures from lctx, restricted to TypeVars occurring in tps.
Produce a stable fingerprint of the parts of the enclosing call-site state that a cached helper's RHS captures from lctx, restricted to TypeVars occurring in tps.
Helpers in cachedTopLevelHelpers are built once per cache key and reused on subsequent hits — but their RHS bodies often consult typeVarReprEnv and the inUplcConstrListScope flag during construction (e.g. element-repr resolution inside an lvMatchList body). If the cache key omits this state, the FIRST caller's env wins, and later callers under a different env get a helper RHS that doesn't match their context. This is the alone-vs-combined Heisenbug pattern documented in sessions 11-15: the same (type, fromRepr, toRepr) cache key produces functionally-different helpers depending on first-miss timing.
Including this fingerprint in the cache key forces helpers with different captured env state to live as separate entries.
Attributes
Define a top-level recursive helper or reuse a previously-cached one for the same key.
Define a top-level recursive helper or reuse a previously-cached one for the same key.
The recipe — shared by ScalusRuntime.builtinListToUplcConstr, ScalusRuntime.uplcConstrToBuiltinList, and LoweringEq.createSumEqHelper — is:
- Look up
cacheKeyin cachedTopLevelHelpers. On hit, return the cached var. - On miss, allocate a fresh
VariableLoweredValuefromfunType/funRepr. - Register it in the cache BEFORE building the rhs so the rhs (built by
buildRhs) can refer to the var for self-recursion. - Build the rhs by calling
buildRhs(v). - Append
(v, rhs)to pendingTopLevelLetRecs so the lowering driver emits the let-rec wrapping the lowered SIR root.
label is the short site name passed to LoweringContext.traceLetRec — used when filtering SCALUS_TRACE_LETREC output.
Attributes
Find a binding in a provider module by module name and method name.
Find a binding in a provider module by module name and method name.
Attributes
Cache lookup with a diagnostic disable knob. Call sites should use this instead of cachedTopLevelHelpers.get(...) directly so the disable flag covers them uniformly.
Cache lookup with a diagnostic disable knob. Call sites should use this instead of cachedTopLevelHelpers.get(...) directly so the disable flag covers them uniformly.
Attributes
If this is typevariable, try get the value from context, else leave it as is.
If this is typevariable, try get the value from context, else leave it as is.
Attributes
Concrete fields
Annotation-keyed cache of pre-lowered values. Indexed by Int.
Annotation-keyed cache of pre-lowered values. Indexed by Int.
Used by intrinsic resolution as an alternative to identity-based precomputedValues: the resolver substitutes references to lambda parameters with SIR.Var(name, type, anns + "argCache" → Const(Integer(idx))). lowerSIR checks the annotation and returns argCache(idx) directly. Survives substituteVarAndTypes walking that creates fresh SIR.Var instances (annotations are preserved in the copy).
Attributes
Cache for top-level recursive helpers (e.g. per-type sumEq functions emitted by LoweringEq.generateSumUplcConstrEquals). Keyed by a stable type-fingerprint string. Each entry is the recursive IdentifiableLoweredValue that subsequent uses can reference; the corresponding rhs is registered in pendingTopLevelLetRecs and emitted as a let-rec wrapping the lowered SIR root.
Cache for top-level recursive helpers (e.g. per-type sumEq functions emitted by LoweringEq.generateSumUplcConstrEquals). Keyed by a stable type-fingerprint string. Each entry is the recursive IdentifiableLoweredValue that subsequent uses can reference; the corresponding rhs is registered in pendingTopLevelLetRecs and emitted as a let-rec wrapping the lowered SIR root.
Attributes
Pending top-level let-rec bindings collected during lowering. After Lowering.lowerSIR returns the lowered SIR root, the lowering driver wraps it with a chain of let-recs for each entry. Entries are appended by innermost-completing helpers first (helper +=s AFTER any transitively-triggered sub-helpers have completed their own +=), so with foldRight wrapping, the first entry becomes outermost — inner helpers can see their outer dependencies. NOT sound for mutually recursive sums; detect and reject those at helper-construction time.
Pending top-level let-rec bindings collected during lowering. After Lowering.lowerSIR returns the lowered SIR root, the lowering driver wraps it with a chain of let-recs for each entry. Entries are appended by innermost-completing helpers first (helper +=s AFTER any transitively-triggered sub-helpers have completed their own +=), so with foldRight wrapping, the first entry becomes outermost — inner helpers can see their outer dependencies. NOT sound for mutually recursive sums; detect and reject those at helper-construction time.