Function count_dispatch
pub fn count_dispatch(source: &str) -> usizeExpand description
The Jones-optimality oracle: count the units of interpreter dispatch remaining in a residual program.
A residual that is genuinely Jones-optimal has dissolved the interpreter entirely and returns zero. One unit is counted for each of:
- an
Inspectarm dispatching on a Core IR variant (CInt,CIf, …); - an environment/function-map lookup
item <literal> of env/... of funcs; - a Core IR constructor (
new CInt, aCInt(...)call, aVIntvariant, …); - a call to a known dispatch function ([
DISPATCH_FN_NAMES]).
Unlike verify_no_overhead_source, this walks the whole tree and accumulates a
count rather than short-circuiting on the first violation.