Step 5.5 phase 4 (partial): add OP_PERFORM to vm.sx spec
Adds opcode 112 (OP_PERFORM / IO suspension) to lib/vm.sx's vm-step dispatch. The native sx_vm.ml already has this opcode — this brings the SX spec into alignment. Full VM transpilation deferred to Step 6 (define-record-type): the dict-based state in vm.sx maps to get_val/sx_dict_set_b calls which are ~5x slower than native record/array access in the hot loop. define-record-type will let vm.sx use typed records that the transpiler maps to OCaml records natively. 2598/2598 tests passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -516,6 +516,10 @@
|
|||||||
(vm-push vm (inc (vm-pop vm)))
|
(vm-push vm (inc (vm-pop vm)))
|
||||||
(= op 175)
|
(= op 175)
|
||||||
(vm-push vm (dec (vm-pop vm)))
|
(vm-push vm (dec (vm-pop vm)))
|
||||||
|
(= op 112)
|
||||||
|
(let
|
||||||
|
((request (vm-pop vm)))
|
||||||
|
(error (str "VM: IO suspension (OP_PERFORM) — request: " request)))
|
||||||
:else (error (str "VM: unknown opcode " op))))))
|
:else (error (str "VM: unknown opcode " op))))))
|
||||||
|
|
||||||
(define
|
(define
|
||||||
|
|||||||
Reference in New Issue
Block a user