writeonce/compiler/test/golden/bc/iface.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

69 lines
1.6 KiB
Text

== CONSTANTS ==
k0 TEXT "Book"
k1 TEXT "Toy"
k2 TEXT "Priced"
k3 TEXT "current_price"
k4 TEXT "quote"
k5 TEXT "main"
k6 INT 2
k7 INT 3
k8 INT 10
k9 INT 5
== CLASSES ==
c0 Book flags=- fields=[SCALAR]
c1 Toy flags=- fields=[SCALAR]
== INTERFACES ==
i0 Priced methods=1 slots=s0..s0
== VTABLES ==
c0 i0 slots s0.. -> [m0]
c1 i0 slots s0.. -> [m1]
== METHODS ==
m0 current_price args=1 regs=3 [class c0]
lines: 0->15
drops: (none)
0000 GETF r1, r0, f0
0001 LOADK r2, k6
0002 ADD r1, r1, r2
0003 RET r1
m1 current_price args=1 regs=3 [class c1]
lines: 0->23
drops: (none)
0000 GETF r1, r0, f0
0001 LOADK r2, k7
0002 MUL r1, r1, r2
0003 RET r1
m2 quote args=1 regs=2 [free fn]
lines: 0->28
drops: (none)
0000 MOVE r1, r0
0001 ICALL r1, s0
0002 RET r1
m3 main args=0 regs=4 [free fn] [ENTRY]
lines: 0->32 3->33 6->34 10->35 14->36 18->31
drops: pc 3 owned={r0} gc={}
drops: pc 6 owned={r0,r1} gc={}
drops: pc 19 owned={r0} gc={}
drops: pc 20 owned={} gc={}
0000 NEW r0, c0
0001 LOADK r1, k8
0002 SETF r0, f0, r1
0003 NEW r1, c1
0004 LOADK r2, k9
0005 SETF r1, f0, r2
0006 MOVE r3, r0
0007 CALL r3, m2
0008 MOVE r2, r3
0009 BUILTIN r2, r2, print_int
0010 MOVE r3, r1
0011 CALL r3, m2
0012 MOVE r2, r3
0013 BUILTIN r2, r2, print_int
0014 MOVE r3, r0
0015 CALL r3, m0
0016 MOVE r2, r3
0017 BUILTIN r2, r2, print_int
0018 DROP r1
0019 DROP r0
0020 RET0
== ENTRY ==
m3