Reviewing. Successfuly reworked register allocation for tape runs.

This commit is contained in:
ed
2026-08-18 00:26:36 -04:00
parent 5a4bfb1224
commit da007d342e
19 changed files with 841 additions and 1787 deletions
+16 -16
View File
@@ -2,7 +2,7 @@
local scan = require("duffle_scan")
local isa = require("duffle_isa")
local emit = require("duffle_emit")
local M = {}
local M = {}
local function merge(src, label)
for k, v in pairs(src) do
@@ -18,30 +18,30 @@ merge(isa, "duffle_isa")
merge(emit, "duffle_emit")
function M.corpus_view(ctx)
local corpus = ctx and ctx.shared and ctx.shared.corpus
local corpus = ctx and ctx.shared and ctx.shared.corpus
if not corpus then error("requires ctx.shared.corpus", 0) end
return {
register_alias_registry = corpus.register_alias_registry or {},
type_name_registry = corpus.type_name_registry or {},
atom_views = corpus.atom_views or {},
atom_ctxs = corpus.atom_ctxs or {},
atom_phases = corpus.atom_phases or {},
binds_by_name = corpus.binds_by_name or {},
atoms_by_name = corpus.atoms_by_name or {},
atom_infos = corpus.atom_infos or {},
components = corpus.components or {},
component_atom_infos = corpus.component_atom_infos or {},
component_body_index = corpus.component_body_index or {},
tape_chains = corpus.tape_chains or {},
source_order = corpus.source_order or {},
collisions = corpus.collisions or {},
type_name_registry = corpus.type_name_registry or {},
atom_views = corpus.atom_views or {},
atom_ctxs = corpus.atom_ctxs or {},
atom_phases = corpus.atom_phases or {},
binds_by_name = corpus.binds_by_name or {},
atoms_by_name = corpus.atoms_by_name or {},
atom_infos = corpus.atom_infos or {},
components = corpus.components or {},
component_atom_infos = corpus.component_atom_infos or {},
component_body_index = corpus.component_body_index or {},
tape_chains = corpus.tape_chains or {},
source_order = corpus.source_order or {},
collisions = corpus.collisions or {},
}
end
function M.run_check_rules(rules, phase, item, pipe_ctx, findings)
for _, rule in ipairs(rules) do
local fn = rule[phase]
if fn then fn(item, pipe_ctx, findings) end
if fn then fn(item, pipe_ctx, findings) end
end
end