feat: code generation for diverts, wip

This commit is contained in:
Brett Broadhurst 2026-03-17 23:19:54 -06:00
parent ee26be6254
commit 20292bcc6a
Failed to generate hash of commit
5 changed files with 699 additions and 149 deletions

View file

@ -110,8 +110,8 @@ pub fn dumpInst(
.store => return d.dumpByteInst(path, offset, op),
.load_global => return d.dumpGlobalInst(path, offset, op),
.store_global => return d.dumpGlobalInst(path, offset, op),
.call => return d.dumpGlobalInst(path, offset, op),
.divert => return d.dumpGlobalInst(path, offset, op),
.call => return d.dumpByteInst(path, offset, op),
.divert => return d.dumpByteInst(path, offset, op),
.jmp => return d.dumpJumpInst(path, offset, op, .relative),
.jmp_t => return d.dumpJumpInst(path, offset, op, .relative),
.jmp_f => return d.dumpJumpInst(path, offset, op, .relative),
@ -143,6 +143,7 @@ pub fn dump(d: Dumper, path: *const Object.ContentPath) !void {
var index: usize = 0;
while (index < path.bytes.len) {
index = try d.dumpInst(path, index, false);
try d.writer.flush();
}
return d.writer.flush();
}