writeonce/compiler/test/golden/bc/owned.expected
shoney.arickathil 79605cbb4f feat: milestone 1 complete — .wob emitter, conformance corpus, single binary; GC redesign specced
- `woc` now emits `.wob` that `wovm` runs: emit.ml lowers the typed,
  owner-annotated AST (scope-stack registers with a >64 WO-E401 diagnostic,
  Lua-style call windows, ICALL by slot, dedup const pool, drop maps, line
  tables, implicit terminators); disasm.ml backs `--dump-bc` goldens.
- Ownership lowering consumes the four owner tables verbatim; RESIDUAL is the
  only source of borrow ops, coalesced per operand. Review caught the emitter
  consuming only 2 of owner.ml's 4 residual producers — an assignment-anchored
  aliasing violation ran to exit 0 instead of trapping; fixed, plus a backstop
  raising WO-E404 for any residual region left unconsumed.
- Conformance harness `scripts/oop-e2e.sh` (`just oop-e2e`): four fixture
  kinds with exact outcomes — byte-exact stdout, one WO-E### anchored on
  `error CODE:`, numeric trap code, gc trace. 25 fixtures incl. pricing-demo
  logic, the ownership suite, and DB_STUB's parse-but-trap. `tests/` un-ignored
  so the corpus is actually tracked.
- `woc build` produces a self-contained binary: wovm copy + appended image +
  20-byte trailer, self-exec via /proc/self/exe. Verified relocated outside
  the repo, argless, and against adversarial trailer corruption.
- Milestone 1's five spec criteria all MET (`just oop-accept`). Criterion 3
  closed by WO-E405 — the entry must return `Int`, since program mode already
  says its return value is the exit code — which deletes the leak class
  without adding return-type metadata to the format. `gc/held-cycle` retired:
  an externally-held cycle is not expressible in a post-exit pump.
- New spec: inferred GC + incremental per-shard tri-color mark-sweep, retiring
  `@gc` and reference counting. Story gains iterations 7b (that work) and 9b
  (`@table`, relations, compiler-checked query); `.dev/reference` gains a
  sparse System.Linq checkout. Priority: 5→6→7 (log-watcher) then 7b, 8, 9, 9b.
2026-08-11 19:31:26 +02:00

65 lines
1.5 KiB
Text

== CONSTANTS ==
k0 TEXT "Item"
k1 TEXT "consume"
k2 TEXT "twice"
k3 TEXT "main"
k4 INT 2
k5 INT 3
k6 INT 5
k7 INT 0
== CLASSES ==
c0 Item flags=- fields=[SCALAR]
== INTERFACES ==
== VTABLES ==
== METHODS ==
m0 consume args=1 regs=2 [free fn]
lines: 0->11
drops: pc 0 owned={r0} gc={}
drops: pc 2 owned={} gc={}
0000 GETF r1, r0, f0
0001 DROP r0
0002 RET r1
m1 twice args=2 regs=6 [free fn]
lines: 0->15 3->16 5->17 8->18 13->20
drops: pc 0 owned={r0} gc={}
drops: pc 3 owned={r0,r2} gc={}
drops: pc 8 owned={r0,r2,r3} gc={}
drops: pc 10 owned={r0,r2} gc={}
drops: pc 11 owned={r0} gc={}
drops: pc 12 owned={} gc={}
drops: pc 13 owned={r0,r2} gc={}
drops: pc 14 owned={r2} gc={}
drops: pc 19 owned={} gc={}
0000 NEW r2, c0
0001 LOADK r3, k4
0002 SETF r2, f0, r3
0003 MOVE r3, r1
0004 JZ r3, -> 0013
0005 NEW r3, c0
0006 LOADK r4, k5
0007 SETF r3, f0, r4
0008 GETF r4, r3, f0
0009 DROP r3
0010 DROP r2
0011 DROP r0
0012 RET r4
0013 MOVE r4, r0
0014 CALL r4, m0
0015 MOVE r3, r4
0016 GETF r5, r2, f0
0017 ADD r3, r3, r5
0018 DROP r2
0019 RET r3
m2 main args=0 regs=4 [free fn] [ENTRY]
lines: 0->24 7->23
drops: (none)
0000 NEW r1, c0
0001 LOADK r3, k6
0002 SETF r1, f0, r3
0003 LOADK r2, k7
0004 CALL r1, m1
0005 MOVE r0, r1
0006 BUILTIN r0, r0, print_int
0007 RET0
== ENTRY ==
m2