Expand description
Thread-safe IR cache for compiled function arities.
Each CljxFnArity is assigned a unique ir_arity_id at creation time.
When a function is called, the cache is consulted:
NotAttempted→ try lowering via the Clojure compilerCached(ir)→ execute via IR interpreterUnsupported→ fall back to tree-walking (don’t retry)
The hot path (get_cached) uses RwLock so concurrent reads don’t
contend. Writes (store) are infrequent (only during lowering).
Enums§
- IrCache
Entry - State of an IR cache entry for one function arity.
Functions§
- get_
cached - Look up a cached IR function by arity ID.
Returns
Noneif not cached or if lowering previously failed. ReturnsSome(ir)if cached. - should_
attempt - Check if lowering should be attempted for this arity.
Returns
trueif the entry isNotAttempted(or absent). - store_
cached - Store a successful IR compilation result.
- store_
unsupported - Mark an arity as unsupported (lowering failed; don’t retry).