( root: BaseNode, references: readonly BaseNode[] )
| 153 | |
| 154 | // a deferred Type's nodes aren't bound to another Type's unit |
| 155 | export const precompileRoot = ( |
| 156 | root: BaseNode, |
| 157 | references: readonly BaseNode[] |
| 158 | ): void => { |
| 159 | const unbound: UnboundTraversals = new Map() |
| 160 | for (const reference of references) { |
| 161 | if (reference === root || !reference.c.preJit) continue |
| 162 | for (const id in reference.byId) unbound.set(reference.byId[id], undefined) |
| 163 | } |
| 164 | // an apply checking data uncompiled to write in place reads no copy |
| 165 | for (const node of $ark.inPlace?.checking ?? []) unbound.set(node, undefined) |
| 166 | unbound.delete(root) |
| 167 | precompile(references, undefined, unbound, root) |
| 168 | // what an apply writing in place reads rather than compiling again |
| 169 | if ($ark.inPlace) root.c.unbound = unbound |
| 170 | } |
| 171 | |
| 172 | export const precompileInPlace = ( |
| 173 | root: BaseRoot, |
no test coverage detected