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

50 lines
1.2 KiB
Text

== CONSTANTS ==
k0 TEXT "compute"
k1 TEXT "main"
k2 INT 0
k3 INT 7
k4 INT 3
k5 TEXT "done"
== CLASSES ==
== INTERFACES ==
== VTABLES ==
== METHODS ==
m0 compute args=2 regs=11 [free fn]
lines: 0->7 1->8 2->9 3->10 4->11 7->12 8->13 10->14 11->16 14->17 16->18 17->17 18->20 20->21 22->23
drops: (none)
0000 ADD r2, r0, r1
0001 SUB r3, r0, r1
0002 MUL r4, r2, r3
0003 DIV r5, r4, r1
0004 DIV r7, r4, r1
0005 MUL r7, r7, r1
0006 SUB r6, r4, r7
0007 NEG r7, r6
0008 EQ r8, r2, r3
0009 JZ r8, -> 0011
0010 RET r7
0011 EQ r9, r2, r3
0012 LOADK r10, k2
0013 EQ r8, r9, r10
0014 MOVE r9, r8
0015 JZ r9, -> 0018
0016 LOADK r8, k2
0017 JMP -> 0014
0018 LT r9, r3, r2
0019 JZ r9, -> 0022
0020 ADD r9, r5, r6
0021 RET r9
0022 RET r7
m1 main args=0 regs=3 [free fn] [ENTRY]
lines: 0->27 5->28 7->26
drops: (none)
0000 LOADK r1, k3
0001 LOADK r2, k4
0002 CALL r1, m0
0003 MOVE r0, r1
0004 BUILTIN r0, r0, print_int
0005 LOADK r0, k5
0006 BUILTIN r0, r0, print
0007 RET0
== ENTRY ==
m1