Commit Graph
1 Commits
Author SHA1 Message Date
Malte Ubl 0d7ee4d38b Read never-written captured bindings through plain locals
Captured bindings live in shared boxes, and every analysis skips boxed
locals: a function-wrapped program's const N turned all index math into
checked f64 arithmetic and every captured array read into a retained box
load. copyStableCaptures keeps the boxes (environments, ownership and
cycle tracing are unchanged) but reads bindings that nothing writes after
their only initialization through plain immutable locals: split
declarations in the declaring function, one entry copy per closure body,
and numeric constants propagated into the copy. Hoisted function
bindings qualify through their single assignment, and calls through a
binding of an environment-free function become direct calls of a
capture-free copy (int32 ABI clones and inlining apply).

Constant callbacks resolve hoisted function bindings, copies of a
scalar capture keep double storage, and AmbientReceiverReaders moves to
ir/ so the pass can use it.
2026-10-16 06:38:42 -07:00