1.9 KiB
1.9 KiB
PR-1.6 — Canonical Function Boundaries & FRAME_SYNC Placement (Bytecode Layout)
Briefing
GC and coroutine scheduling rely on deterministic safepoints. The bytecode layout must define canonical function boundaries and FRAME_SYNC semantics at the bytecode layer.
Target
- Enforce canonical function ranges and end labels.
- Ensure
FRAME_SYNCplacement rules are representable and checkable.
Work items
-
Review current layout utilities and make them canonical for:
- Computing function
code_len. - Determining valid jump targets (instruction boundaries).
- Determining function end boundary.
- Computing function
-
Document
FRAME_SYNCat the bytecode level:- What it signals.
- Where it is required (as per updated specs).
-
Update disasm to clearly display
FRAME_SYNC.
Acceptance checklist
- Function boundaries are computed via a single canonical routine.
FRAME_SYNCis clearly represented and documented.- Existing verifier/layout tests (if any) are updated.
cargo testpasses.
Tests
- Add or update unit tests for layout boundary correctness (e.g., end-exclusive semantics).
PR-1.7 — Bytecode Roundtrip Tests (Encode/Decode/Disasm Sanity)
Briefing
Before touching VM behavior, we want confidence that the bytecode toolchain is coherent after the ISA reset.
Target
-
Add roundtrip tests that validate:
- Encode → decode preserves structure.
- Disasm prints stable, readable output.
Work items
-
Add a small set of “known-good” bytecode samples built using the new minimal ISA.
-
Implement tests:
- Encode then decode equals original structure.
- Disasm output contains expected instruction names and operands.
-
Keep samples intentionally tiny and deterministic.
Acceptance checklist
- Roundtrip tests exist and pass.
- Samples do not depend on legacy semantics.
cargo testpasses.
Tests
- New unit tests for encode/decode/disasm roundtrip.