Files
rose-ash/shared/static/wasm/sx/vm.sxbc
giles 2727577702 VM import suspension for browser lazy loading
Bytecode compiler now emits OP_PERFORM for (import ...) and compiles
(define-library ...) bodies. The VM stores the import request in
globals["__io_request"] and stops the run loop — no exceptions needed.
vm-execute-module returns a suspension dict, vm-resume-module continues.

Browser: sx_browser.ml detects suspension dicts from execute_module and
returns JS {suspended, op, request, resume} objects. The sx-platform.js
while loop handles cascading suspensions via handleImportSuspension.

13 modules load via .sxbc bytecode in 226ms (manifest-driven), both
islands hydrate, all handlers wired. 2650/2650 tests pass including
6 new vm-import-suspension tests.

Also: consolidated sx-platform-2.js → sx-platform.js, fixed
vm-execute-module missing code-from-value call, fixed bootstrap.py
protocol registry transpiler issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 17:11:12 +00:00

4 lines
23 KiB
Plaintext

(sxbc 1 "2e4b30ff13331736"
(code
:constants ("make-upvalue-cell" {:upvalue-count 0 :arity 1 :constants ("uv-value") :bytecode (1 0 0 16 0 65 1 0 50)} "uv-get" {:upvalue-count 0 :arity 1 :constants ("get" "uv-value") :bytecode (16 0 1 1 0 52 0 0 2 50)} "uv-set!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "uv-value") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "make-vm-code" {:upvalue-count 0 :arity 4 :constants ("vc-bytecode" "vc-locals" "vc-arity" "vc-constants") :bytecode (1 0 0 16 2 1 1 0 16 1 1 2 0 16 0 1 3 0 16 3 65 4 0 50)} "make-vm-closure" {:upvalue-count 0 :arity 5 :constants ("vm-globals" "vm-upvalues" "vm-name" "vm-code" "vm-closure-env") :bytecode (1 0 0 16 3 1 1 0 16 1 1 2 0 16 2 1 3 0 16 0 1 4 0 16 4 65 5 0 50)} "make-vm-frame" {:upvalue-count 0 :arity 2 :constants ("ip" 0 "closure" "base" "local-cells") :bytecode (1 0 0 1 1 0 1 2 0 16 0 1 3 0 16 1 1 4 0 65 0 0 65 4 0 50)} "make-vm" {:upvalue-count 0 :arity 1 :constants ("sp" 0 "frames" "list" "stack" "make-vm-stack" 4096 "globals") :bytecode (1 0 0 1 1 0 1 2 0 52 3 0 0 1 4 0 1 6 0 52 5 0 1 1 7 0 16 0 65 4 0 50)} "vm-push" {:upvalue-count 0 :arity 2 :constants ("get" "sp" "stack" ">=" "vm-stack-length" "make-vm-stack" "*" 2 "vm-stack-copy!" "dict-set!" "vm-stack-set!" "+" 1) :bytecode (16 0 1 1 0 52 0 0 2 17 2 16 0 1 2 0 52 0 0 2 17 3 16 2 16 3 52 4 0 1 52 3 0 2 33 45 0 16 2 1 7 0 52 6 0 2 52 5 0 1 17 4 16 3 16 4 16 2 52 8 0 3 5 16 0 1 2 0 16 4 52 9 0 3 5 16 4 17 3 32 1 0 2 5 16 3 16 2 16 1 52 10 0 3 5 16 0 1 1 0 16 2 1 12 0 52 11 0 2 52 9 0 3 50)} "vm-pop" {:upvalue-count 0 :arity 1 :constants ("-" "get" "sp" 1 "dict-set!" "vm-stack-get" "stack") :bytecode (16 0 1 2 0 52 1 0 2 1 3 0 52 0 0 2 17 1 16 0 1 2 0 16 1 52 4 0 3 5 16 0 1 6 0 52 1 0 2 16 1 52 5 0 2 50)} "vm-peek" {:upvalue-count 0 :arity 1 :constants ("vm-stack-get" "get" "stack" "-" "sp" 1) :bytecode (16 0 1 2 0 52 1 0 2 16 0 1 4 0 52 1 0 2 1 5 0 52 3 0 2 52 0 0 2 50)} "frame-read-u8" {:upvalue-count 0 :arity 1 :constants ("get" "ip" "closure" "vm-code" "vc-bytecode" "nth" "dict-set!" "+" 1) :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 1 3 0 52 0 0 2 1 4 0 52 0 0 2 17 2 16 2 16 1 52 5 0 2 17 3 16 0 1 1 0 16 1 1 8 0 52 7 0 2 52 6 0 3 5 16 3 50)} "frame-read-u16" {:upvalue-count 0 :arity 1 :constants ("frame-read-u8" "+" "*" 256) :bytecode (20 0 0 16 0 48 1 17 1 20 0 0 16 0 48 1 17 2 16 1 16 2 1 3 0 52 2 0 2 52 1 0 2 50)} "frame-read-i16" {:upvalue-count 0 :arity 1 :constants ("frame-read-u16" ">=" 32768 "-" 65536) :bytecode (20 0 0 16 0 48 1 17 1 16 1 1 2 0 52 1 0 2 33 12 0 16 1 1 4 0 52 3 0 2 32 2 0 16 1 50)} "vm-push-frame" {:upvalue-count 0 :arity 3 :constants ("make-vm-frame" "vm-sp" "for-each" {:upvalue-count 1 :arity 1 :constants ("vm-push") :bytecode (20 0 0 18 0 16 0 49 2 50)} "pad-n-nils" "-" "code-locals" "closure-code" "len" "vm-set-frames!" "cons" "vm-frames") :bytecode (20 0 0 16 1 20 1 0 16 0 48 1 48 2 17 3 51 3 0 1 0 16 2 52 2 0 2 5 20 4 0 16 0 20 6 0 20 7 0 16 1 48 1 48 1 16 2 52 8 0 1 52 5 0 2 48 2 5 20 9 0 16 0 16 3 20 11 0 16 0 48 1 52 10 0 2 49 2 50)} "code-from-value" {:upvalue-count 0 :arity 1 :constants ("Convert a compiler output dict to a vm-code object." "not" "dict?" "make-vm-code" 0 16 "list" "get" "bytecode" "nil?" "constants" "arity" "+") :bytecode (1 0 0 5 16 0 52 2 0 1 52 1 0 1 33 22 0 20 3 0 1 4 0 1 5 0 52 6 0 0 52 6 0 0 49 4 32 112 0 16 0 1 8 0 52 7 0 2 17 1 16 1 52 9 0 1 33 7 0 52 6 0 0 32 2 0 16 1 17 2 16 0 1 10 0 52 7 0 2 17 3 16 3 52 9 0 1 33 7 0 52 6 0 0 32 2 0 16 3 17 4 16 0 1 11 0 52 7 0 2 17 5 16 5 52 9 0 1 33 6 0 1 4 0 32 2 0 16 5 17 6 20 3 0 16 6 16 6 1 5 0 52 12 0 2 16 2 16 4 49 4 50)} "vm-closure?" {:upvalue-count 0 :arity 1 :constants ("dict?" "has-key?" "vm-code") :bytecode (16 0 52 0 0 1 6 33 10 0 5 16 0 1 2 0 52 1 0 2 50)} "*active-vm*" "*jit-compile-fn*" "lambda?" {:upvalue-count 0 :arity 1 :constants ("=" "type-of" "lambda") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 50)} "lambda-compiled" {:upvalue-count 0 :arity 1 :constants () :bytecode (2 50)} "lambda-set-compiled!" {:upvalue-count 0 :arity 2 :constants () :bytecode (2 50)} "lambda-name" "cek-call-or-suspend" {:upvalue-count 0 :arity 3 :constants ("cek-call") :bytecode (16 1 16 2 52 0 0 2 50)} "try-jit-call" {:upvalue-count 0 :arity 3 :constants ("lambda-compiled" "vm-closure?" "vm-push" "vm-call-closure" "vm-globals-ref" "=" "jit-failed" "cek-call-or-suspend" "*jit-compile-fn*" "lambda-name" "lambda-set-compiled!") :bytecode (20 0 0 16 1 48 1 17 3 20 1 0 16 3 48 1 33 26 0 20 2 0 16 0 20 3 0 16 3 16 2 20 4 0 16 0 48 1 48 3 49 2 32 163 0 16 3 1 6 0 52 5 0 2 33 21 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 32 130 0 20 8 0 6 33 8 0 5 20 9 0 16 1 48 1 33 94 0 20 10 0 16 1 1 6 0 48 2 5 20 8 0 16 1 20 4 0 16 0 48 1 48 2 17 4 20 1 0 16 4 48 1 33 36 0 20 10 0 16 1 16 4 48 2 5 20 2 0 16 0 20 3 0 16 4 16 2 20 4 0 16 0 48 1 48 3 49 2 32 18 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 32 18 0 20 2 0 16 0 20 7 0 16 0 16 1 16 2 48 3 49 2 50)} "vm-call" {:upvalue-count 0 :arity 3 :constants ("vm-closure?" "vm-push-frame" "lambda?" "try-jit-call" "=" "type-of" "component" "island" "vm-push" "cek-call-or-suspend" "callable?" "apply" "error" "str" "VM: not callable: ") :bytecode (20 0 0 16 1 48 1 33 14 0 20 1 0 16 0 16 1 16 2 49 3 32 123 0 16 1 52 2 0 1 33 14 0 20 3 0 16 0 16 1 16 2 49 3 32 100 0 16 1 52 5 0 1 1 6 0 52 4 0 2 6 34 14 0 5 16 1 52 5 0 1 1 7 0 52 4 0 2 33 21 0 20 8 0 16 0 20 9 0 16 0 16 1 16 2 48 3 49 2 32 45 0 20 10 0 16 1 48 1 33 18 0 20 8 0 16 0 16 1 16 2 52 11 0 2 49 2 32 17 0 1 14 0 16 1 52 5 0 1 52 13 0 2 52 12 0 1 50)} "frame-local-get" {:upvalue-count 0 :arity 3 :constants ("Read a local variable — check shared cells first, then stack." "get" "local-cells" "str" "has-key?" "uv-get" "vm-stack-get" "stack" "+" "base") :bytecode (1 0 0 5 16 1 1 2 0 52 1 0 2 17 3 16 2 52 3 0 1 17 4 16 3 16 4 52 4 0 2 33 16 0 20 5 0 16 3 16 4 52 1 0 2 49 1 32 28 0 16 0 1 7 0 52 1 0 2 16 1 1 9 0 52 1 0 2 16 2 52 8 0 2 52 6 0 2 50)} "frame-local-set" {:upvalue-count 0 :arity 4 :constants ("Write a local variable — to shared cell if captured, else to stack." "get" "local-cells" "str" "has-key?" "uv-set!" "vm-stack-set!" "stack" "+" "base") :bytecode (1 0 0 5 16 1 1 2 0 52 1 0 2 17 4 16 2 52 3 0 1 17 5 16 4 16 5 52 4 0 2 33 18 0 20 5 0 16 4 16 5 52 1 0 2 16 3 49 2 32 30 0 16 0 1 7 0 52 1 0 2 16 1 1 9 0 52 1 0 2 16 2 52 8 0 2 16 3 52 6 0 3 50)} "frame-upvalue-get" {:upvalue-count 0 :arity 2 :constants ("uv-get" "nth" "get" "closure" "vm-upvalues") :bytecode (20 0 0 16 0 1 3 0 52 2 0 2 1 4 0 52 2 0 2 16 1 52 1 0 2 49 1 50)} "frame-upvalue-set" {:upvalue-count 0 :arity 3 :constants ("uv-set!" "nth" "get" "closure" "vm-upvalues") :bytecode (20 0 0 16 0 1 3 0 52 2 0 2 1 4 0 52 2 0 2 16 1 52 1 0 2 16 2 49 2 50)} "frame-ip" {:upvalue-count 0 :arity 1 :constants ("get" "ip") :bytecode (16 0 1 1 0 52 0 0 2 50)} "frame-set-ip!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "ip") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "frame-base" {:upvalue-count 0 :arity 1 :constants ("get" "base") :bytecode (16 0 1 1 0 52 0 0 2 50)} "frame-closure" {:upvalue-count 0 :arity 1 :constants ("get" "closure") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-code" {:upvalue-count 0 :arity 1 :constants ("get" "vm-code") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-upvalues" {:upvalue-count 0 :arity 1 :constants ("get" "vm-upvalues") :bytecode (16 0 1 1 0 52 0 0 2 50)} "closure-env" {:upvalue-count 0 :arity 1 :constants ("get" "closure-env") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-bytecode" {:upvalue-count 0 :arity 1 :constants ("get" "vc-bytecode") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-constants" {:upvalue-count 0 :arity 1 :constants ("get" "vc-constants") :bytecode (16 0 1 1 0 52 0 0 2 50)} "code-locals" {:upvalue-count 0 :arity 1 :constants ("get" "vc-locals") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-sp" {:upvalue-count 0 :arity 1 :constants ("get" "sp") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-sp!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "sp") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-stack" {:upvalue-count 0 :arity 1 :constants ("get" "stack") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-stack!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "stack") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-frames" {:upvalue-count 0 :arity 1 :constants ("get" "frames") :bytecode (16 0 1 1 0 52 0 0 2 50)} "vm-set-frames!" {:upvalue-count 0 :arity 2 :constants ("dict-set!" "frames") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} "vm-globals-ref" {:upvalue-count 0 :arity 1 :constants ("get" "globals") :bytecode (16 0 1 1 0 52 0 0 2 50)} "collect-n-from-stack" {:upvalue-count 0 :arity 2 :constants ("list" 0 {:upvalue-count 5 :arity 0 :constants ("<" "cons" "vm-pop" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 35 0 20 2 0 18 3 48 1 18 2 52 1 0 2 19 2 5 18 0 1 4 0 52 3 0 2 19 0 5 18 4 49 0 32 1 0 2 50)}) :bytecode (52 0 0 0 17 2 1 1 0 17 3 51 2 0 1 3 1 1 1 2 1 0 1 4 17 4 5 16 4 48 0 5 16 2 50)} "pad-n-nils" {:upvalue-count 0 :arity 2 :constants (0 {:upvalue-count 4 :arity 0 :constants ("<" "vm-push" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 28 0 20 1 0 18 2 2 48 2 5 18 0 1 3 0 52 2 0 2 19 0 5 18 3 49 0 32 1 0 2 50)}) :bytecode (1 0 0 17 2 51 1 0 1 2 1 1 1 0 1 3 17 3 5 16 3 49 0 50)} "collect-n-pairs" {:upvalue-count 0 :arity 2 :constants (0 {:upvalue-count 5 :arity 0 :constants ("<" "vm-pop" "dict-set!" "+" 1) :bytecode (18 0 18 1 52 0 0 2 33 48 0 20 1 0 18 2 48 1 17 0 20 1 0 18 2 48 1 17 1 18 3 16 1 16 0 52 2 0 3 5 18 0 1 4 0 52 3 0 2 19 0 5 18 4 49 0 32 1 0 2 50)}) :bytecode (65 0 0 17 2 1 0 0 17 3 51 1 0 1 3 1 1 1 0 1 2 1 4 17 4 5 16 4 48 0 5 16 2 50)} "vm-global-get" {:upvalue-count 0 :arity 3 :constants ("Look up a global: globals table → closure env → primitives → HO wrappers" "get" "globals" "has-key?" "closure" "closure-env" "nil?" "cek-try" {:upvalue-count 1 :arity 0 :constants ("get-primitive") :bytecode (18 0 52 0 0 1 50)} {:upvalue-count 2 :arity 1 :constants ("vm-resolve-ho-form") :bytecode (20 0 0 18 0 18 1 49 2 50)} "env-walk") :bytecode (1 0 0 5 16 0 1 2 0 52 1 0 2 17 3 16 3 16 2 52 3 0 2 33 11 0 16 3 16 2 52 1 0 2 32 87 0 16 1 1 4 0 52 1 0 2 1 5 0 52 1 0 2 17 4 16 4 52 6 0 1 33 19 0 51 8 0 1 2 51 9 0 1 0 1 2 52 7 0 2 32 41 0 20 10 0 16 4 16 2 48 2 17 5 16 5 52 6 0 1 33 19 0 51 8 0 1 2 51 9 0 1 0 1 2 52 7 0 2 32 2 0 16 5 50)} "vm-resolve-ho-form" {:upvalue-count 0 :arity 2 :constants ("=" "for-each" {:upvalue-count 1 :arity 2 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "map" {:upvalue-count 1 :arity 2 :constants ("map" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "map-indexed" {:upvalue-count 1 :arity 2 :constants ("map-indexed" {:upvalue-count 2 :arity 2 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 16 1 52 1 0 2 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "filter" {:upvalue-count 1 :arity 2 :constants ("filter" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "reduce" {:upvalue-count 1 :arity 3 :constants ("reduce" {:upvalue-count 2 :arity 2 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 16 1 52 1 0 2 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 16 2 52 0 0 3 50)} "some" {:upvalue-count 1 :arity 2 :constants ("some" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "every?" {:upvalue-count 1 :arity 2 :constants ("every?" {:upvalue-count 2 :arity 1 :constants ("vm-call-external" "list") :bytecode (20 0 0 18 0 18 1 16 0 52 1 0 1 49 3 50)}) :bytecode (51 1 0 0 0 1 0 16 1 52 0 0 2 50)} "error" "str" "VM undefined: ") :bytecode (16 1 1 1 0 52 0 0 2 33 8 0 51 2 0 1 0 32 133 0 16 1 1 3 0 52 0 0 2 33 8 0 51 4 0 1 0 32 113 0 16 1 1 5 0 52 0 0 2 33 8 0 51 6 0 1 0 32 93 0 16 1 1 7 0 52 0 0 2 33 8 0 51 8 0 1 0 32 73 0 16 1 1 9 0 52 0 0 2 33 8 0 51 10 0 1 0 32 53 0 16 1 1 11 0 52 0 0 2 33 8 0 51 12 0 1 0 32 33 0 16 1 1 13 0 52 0 0 2 33 8 0 51 14 0 1 0 32 13 0 1 17 0 16 1 52 16 0 2 52 15 0 1 50)} "vm-call-external" {:upvalue-count 0 :arity 3 :constants ("vm-closure?" "vm-call-closure" "vm-globals-ref" "cek-call") :bytecode (20 0 0 16 1 48 1 33 19 0 20 1 0 16 1 16 2 20 2 0 16 0 48 1 49 3 32 8 0 16 1 16 2 52 3 0 2 50)} "vm-global-set" {:upvalue-count 0 :arity 4 :constants ("Set a global: write to closure env if name exists there, else globals." "get" "closure" "vm-closure-env" "not" "nil?" "env-walk-set!" "dict-set!" "globals") :bytecode (1 0 0 5 16 1 1 2 0 52 1 0 2 1 3 0 52 1 0 2 17 4 4 17 5 16 4 52 5 0 1 52 4 0 1 33 16 0 20 6 0 16 4 16 2 16 3 48 3 17 5 32 1 0 2 5 16 5 52 4 0 1 33 20 0 16 0 1 8 0 52 1 0 2 16 2 16 3 52 7 0 3 32 1 0 2 50)} "env-walk" {:upvalue-count 0 :arity 2 :constants ("nil?" "env-has?" "env-get" "env-parent" "env-walk") :bytecode (16 0 52 0 0 1 33 4 0 2 32 53 0 16 0 16 1 52 1 0 2 33 11 0 16 0 16 1 52 2 0 2 32 31 0 20 3 0 16 0 48 1 17 2 16 2 52 0 0 1 33 4 0 2 32 9 0 20 4 0 16 2 16 1 49 2 50)} "env-walk-set!" {:upvalue-count 0 :arity 3 :constants ("nil?" "env-has?" "env-set!" "env-parent" "env-walk-set!") :bytecode (16 0 52 0 0 1 33 4 0 4 32 59 0 16 0 16 1 52 1 0 2 33 15 0 16 0 16 1 16 2 52 2 0 3 5 3 32 33 0 20 3 0 16 0 48 1 17 3 16 3 52 0 0 1 33 4 0 4 32 11 0 20 4 0 16 3 16 1 16 2 49 3 50)} "vm-create-closure" {:upvalue-count 0 :arity 3 :constants ("Create a closure from a code constant. Reads upvalue descriptors\n from the bytecode stream and captures values from the enclosing frame." "code-from-value" "dict?" "get" "upvalue-count" "nil?" 0 "list" {:upvalue-count 6 :arity 0 :constants ("<" "frame-read-u8" "=" 1 "get" "local-cells" "str" "has-key?" "make-upvalue-cell" "vm-stack-get" "stack" "+" "base" "dict-set!" "nth" "closure" "vm-upvalues" "append!") :bytecode (18 0 18 1 52 0 0 2 33 174 0 20 1 0 18 2 48 1 17 0 20 1 0 18 2 48 1 17 1 16 0 1 3 0 52 2 0 2 33 92 0 18 2 1 5 0 52 4 0 2 17 3 16 1 52 6 0 1 17 4 16 3 16 4 52 7 0 2 33 11 0 16 3 16 4 52 4 0 2 32 48 0 20 8 0 18 3 1 10 0 52 4 0 2 18 2 1 12 0 52 4 0 2 16 1 52 11 0 2 52 9 0 2 48 1 17 5 16 3 16 4 16 5 52 13 0 3 5 16 5 32 22 0 18 2 1 15 0 52 4 0 2 1 16 0 52 4 0 2 16 1 52 14 0 2 17 2 18 4 16 2 52 17 0 2 5 18 0 1 3 0 52 11 0 2 19 0 5 18 5 49 0 32 1 0 2 50)} "make-vm-closure" "globals") :bytecode (1 0 0 5 20 1 0 16 2 48 1 17 3 16 2 52 2 0 1 33 31 0 16 2 1 4 0 52 3 0 2 17 5 16 5 52 5 0 1 33 6 0 1 6 0 32 2 0 16 5 32 3 0 1 6 0 17 4 52 7 0 0 17 6 1 6 0 17 7 51 8 0 1 7 1 4 1 1 1 0 1 6 1 8 17 8 5 16 8 48 0 5 16 6 17 5 20 9 0 16 3 16 5 2 16 0 1 10 0 52 3 0 2 2 49 5 50)} "vm-run" {:upvalue-count 0 :arity 2 :constants ("Execute bytecode until all frames are consumed." {:upvalue-count 2 :arity 0 :constants ("not" "empty?" "vm-frames" "first" "rest" "code-bytecode" "closure-code" "frame-closure" "code-constants" ">=" "frame-ip" "len" "vm-set-frames!" "list" "vm-step" "nil?" "get" "vm-globals-ref" "__io_request") :bytecode (20 2 0 18 0 48 1 52 1 0 1 52 0 0 1 33 146 0 20 2 0 18 0 48 1 52 3 0 1 17 0 20 2 0 18 0 48 1 52 4 0 1 17 1 20 5 0 20 6 0 20 7 0 16 0 48 1 48 1 48 1 17 2 20 8 0 20 6 0 20 7 0 16 0 48 1 48 1 48 1 17 3 20 10 0 16 0 48 1 16 2 52 11 0 1 52 9 0 2 33 14 0 20 12 0 18 0 52 13 0 0 49 2 32 45 0 20 14 0 18 0 16 0 16 1 16 2 16 3 48 5 5 20 17 0 18 0 48 1 1 18 0 52 16 0 2 52 15 0 1 33 7 0 18 1 49 0 32 1 0 2 32 1 0 2 50)}) :bytecode (1 0 0 5 51 1 0 1 0 1 1 17 1 5 16 1 49 0 50)} "vm-step" {:upvalue-count 0 :arity 5 :constants ("frame-read-u8" "=" 1 "frame-read-u16" "vm-push" "nth" 2 3 4 5 "vm-pop" 6 "vm-peek" 16 "frame-local-get" 17 "frame-local-set" 18 "frame-upvalue-get" 19 "frame-upvalue-set" 20 "vm-global-get" 21 "vm-global-set" 32 "frame-read-i16" "frame-set-ip!" "+" "frame-ip" 33 "not" 34 48 "collect-n-from-stack" "vm-call" 49 "vm-set-frames!" "vm-set-sp!" "frame-base" 50 51 "vm-create-closure" 52 "call-primitive" 64 65 "collect-n-pairs" 144 "apply" "str" 128 "dict-set!" "vm-globals-ref" 160 161 "-" 162 "*" 163 "/" 164 165 "<" 166 ">" 167 168 "len" 169 "first" 170 "rest" 171 172 "cons" 173 0 174 "inc" 175 "dec" 112 "__io_request" "error" "VM: unknown opcode ") :bytecode (20 0 0 16 1 48 1 17 5 16 5 1 2 0 52 1 0 2 33 27 0 20 3 0 16 1 48 1 17 6 20 4 0 16 0 16 4 16 6 52 5 0 2 49 2 32 254 6 16 5 1 6 0 52 1 0 2 33 11 0 20 4 0 16 0 2 49 2 32 231 6 16 5 1 7 0 52 1 0 2 33 11 0 20 4 0 16 0 3 49 2 32 208 6 16 5 1 8 0 52 1 0 2 33 11 0 20 4 0 16 0 4 49 2 32 185 6 16 5 1 9 0 52 1 0 2 33 10 0 20 10 0 16 0 49 1 32 163 6 16 5 1 11 0 52 1 0 2 33 17 0 20 4 0 16 0 20 12 0 16 0 48 1 49 2 32 134 6 16 5 1 13 0 52 1 0 2 33 30 0 20 0 0 16 1 48 1 17 6 20 4 0 16 0 20 14 0 16 0 16 1 16 6 48 3 49 2 32 92 6 16 5 1 15 0 52 1 0 2 33 30 0 20 0 0 16 1 48 1 17 6 20 16 0 16 0 16 1 16 6 20 12 0 16 0 48 1 49 4 32 50 6 16 5 1 17 0 52 1 0 2 33 28 0 20 0 0 16 1 48 1 17 6 20 4 0 16 0 20 18 0 16 1 16 6 48 2 49 2 32 10 6 16 5 1 19 0 52 1 0 2 33 28 0 20 0 0 16 1 48 1 17 6 20 20 0 16 1 16 6 20 12 0 16 0 48 1 49 3 32 226 5 16 5 1 21 0 52 1 0 2 33 40 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 4 0 16 0 20 22 0 16 0 16 1 16 7 48 3 49 2 32 174 5 16 5 1 23 0 52 1 0 2 33 40 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 24 0 16 0 16 1 16 7 20 12 0 16 0 48 1 49 4 32 122 5 16 5 1 25 0 52 1 0 2 33 32 0 20 26 0 16 1 48 1 17 6 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 78 5 16 5 1 30 0 52 1 0 2 33 54 0 20 26 0 16 1 48 1 17 6 20 10 0 16 0 48 1 17 7 16 7 52 31 0 1 33 23 0 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 1 0 2 32 12 5 16 5 1 32 0 52 1 0 2 33 50 0 20 26 0 16 1 48 1 17 6 20 10 0 16 0 48 1 17 7 16 7 33 23 0 20 27 0 16 1 20 29 0 16 1 48 1 16 6 52 28 0 2 49 2 32 1 0 2 32 206 4 16 5 1 33 0 52 1 0 2 33 43 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 10 0 16 0 48 1 17 8 20 35 0 16 0 16 8 16 7 49 3 32 151 4 16 5 1 36 0 52 1 0 2 33 68 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 10 0 16 0 48 1 17 8 20 37 0 16 0 16 2 48 2 5 20 38 0 16 0 20 39 0 16 1 48 1 48 2 5 20 35 0 16 0 16 8 16 7 49 3 32 71 4 16 5 1 40 0 52 1 0 2 33 46 0 20 10 0 16 0 48 1 17 6 20 37 0 16 0 16 2 48 2 5 20 38 0 16 0 20 39 0 16 1 48 1 48 2 5 20 4 0 16 0 16 6 49 2 32 13 4 16 5 1 41 0 52 1 0 2 33 44 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 42 0 16 0 16 1 16 7 48 3 17 8 20 4 0 16 0 16 8 49 2 32 213 3 16 5 1 43 0 52 1 0 2 33 57 0 20 3 0 16 1 48 1 17 6 20 0 0 16 1 48 1 17 7 16 4 16 6 52 5 0 2 17 8 20 34 0 16 0 16 7 48 2 17 9 20 4 0 16 0 16 8 16 9 52 44 0 2 49 2 32 144 3 16 5 1 45 0 52 1 0 2 33 32 0 20 3 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 4 0 16 0 16 7 49 2 32 100 3 16 5 1 46 0 52 1 0 2 33 32 0 20 3 0 16 1 48 1 17 6 20 47 0 16 0 16 6 48 2 17 7 20 4 0 16 0 16 7 49 2 32 56 3 16 5 1 48 0 52 1 0 2 33 39 0 20 0 0 16 1 48 1 17 6 20 34 0 16 0 16 6 48 2 17 7 20 4 0 16 0 20 50 0 16 7 52 49 0 2 49 2 32 5 3 16 5 1 51 0 52 1 0 2 33 42 0 20 3 0 16 1 48 1 17 6 16 4 16 6 52 5 0 2 17 7 20 53 0 16 0 48 1 16 7 20 12 0 16 0 48 1 52 52 0 3 32 207 2 16 5 1 54 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 28 0 2 49 2 32 159 2 16 5 1 55 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 56 0 2 49 2 32 111 2 16 5 1 57 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 58 0 2 49 2 32 63 2 16 5 1 59 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 60 0 2 49 2 32 15 2 16 5 1 61 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 1 0 2 49 2 32 223 1 16 5 1 62 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 63 0 2 49 2 32 175 1 16 5 1 64 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 65 0 2 49 2 32 127 1 16 5 1 66 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 31 0 1 49 2 32 94 1 16 5 1 67 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 68 0 1 49 2 32 61 1 16 5 1 69 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 70 0 1 49 2 32 28 1 16 5 1 71 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 72 0 1 49 2 32 251 0 16 5 1 73 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 5 0 2 49 2 32 203 0 16 5 1 74 0 52 1 0 2 33 36 0 20 10 0 16 0 48 1 17 6 20 10 0 16 0 48 1 17 7 20 4 0 16 0 16 7 16 6 52 75 0 2 49 2 32 155 0 16 5 1 76 0 52 1 0 2 33 24 0 20 4 0 16 0 1 77 0 20 10 0 16 0 48 1 52 56 0 2 49 2 32 119 0 16 5 1 78 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 79 0 1 49 2 32 86 0 16 5 1 80 0 52 1 0 2 33 21 0 20 4 0 16 0 20 10 0 16 0 48 1 52 81 0 1 49 2 32 53 0 16 5 1 82 0 52 1 0 2 33 28 0 20 10 0 16 0 48 1 17 6 20 53 0 16 0 48 1 1 83 0 16 6 52 52 0 3 32 13 0 1 85 0 16 5 52 50 0 2 52 84 0 1 50)} "vm-call-closure" {:upvalue-count 0 :arity 3 :constants ("*active-vm*" "make-vm" "vm-push-frame" "vm-run" "vm-pop") :bytecode (20 0 0 17 3 20 1 0 16 2 48 1 17 4 16 4 21 0 0 5 20 2 0 16 4 16 0 16 1 48 3 5 20 3 0 16 4 48 1 5 16 3 21 0 0 5 20 4 0 16 4 49 1 50)} "vm-execute-module" {:upvalue-count 0 :arity 2 :constants ("code-from-value" "make-vm" "make-vm-closure" "list" "module" "make-vm-frame" 0 "pad-n-nils" "code-locals" "vm-set-frames!" "vm-run" "get" "vm-globals-ref" "__io_request" "nil?" "vm-pop" "vm" "suspended" "op" "import" "request") :bytecode (20 0 0 16 0 48 1 17 2 20 1 0 16 1 48 1 17 3 20 2 0 16 2 52 3 0 0 1 4 0 16 1 2 48 5 17 4 20 5 0 16 4 1 6 0 48 2 17 5 20 7 0 16 3 20 8 0 16 2 48 1 48 2 5 20 9 0 16 3 16 5 52 3 0 1 48 2 5 20 10 0 16 3 48 1 5 20 12 0 16 3 48 1 1 13 0 52 11 0 2 17 6 16 6 52 14 0 1 33 10 0 20 15 0 16 3 49 1 32 23 0 1 16 0 16 3 1 17 0 3 1 18 0 1 19 0 1 20 0 16 6 65 4 0 50)} "vm-resume-module" {:upvalue-count 0 :arity 1 :constants ("Resume a suspended VM after IO (import) has been resolved.\n Clears __io_request in globals, pushes nil (import result), re-runs." "get" "vm" "dict-set!" "vm-globals-ref" "__io_request" "vm-push" "vm-run" "nil?" "vm-pop" "suspended" "op" "import" "request") :bytecode (1 0 0 5 16 0 1 2 0 52 1 0 2 17 1 20 4 0 16 1 48 1 1 5 0 2 52 3 0 3 5 20 6 0 16 1 2 48 2 5 20 7 0 16 1 48 1 5 20 4 0 16 1 48 1 1 5 0 52 1 0 2 17 2 16 2 52 8 0 1 33 10 0 20 9 0 16 1 49 1 32 23 0 1 2 0 16 1 1 10 0 3 1 11 0 1 12 0 1 13 0 16 2 65 4 0 50)} {:library (sx vm) :op "import"}) :bytecode (51 1 0 128 0 0 5 51 3 0 128 2 0 5 51 5 0 128 4 0 5 51 7 0 128 6 0 5 51 9 0 128 8 0 5 51 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 51 31 0 128 30 0 5 2 128 32 0 5 2 128 33 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 37 0 128 40 0 5 51 42 0 128 41 0 5 51 44 0 128 43 0 5 51 46 0 128 45 0 5 51 48 0 128 47 0 5 51 50 0 128 49 0 5 51 52 0 128 51 0 5 51 54 0 128 53 0 5 51 56 0 128 55 0 5 51 58 0 128 57 0 5 51 60 0 128 59 0 5 51 62 0 128 61 0 5 51 64 0 128 63 0 5 51 66 0 128 65 0 5 51 68 0 128 67 0 5 51 70 0 128 69 0 5 51 72 0 128 71 0 5 51 74 0 128 73 0 5 51 76 0 128 75 0 5 51 78 0 128 77 0 5 51 80 0 128 79 0 5 51 82 0 128 81 0 5 51 84 0 128 83 0 5 51 86 0 128 85 0 5 51 88 0 128 87 0 5 51 90 0 128 89 0 5 51 92 0 128 91 0 5 51 94 0 128 93 0 5 51 96 0 128 95 0 5 51 98 0 128 97 0 5 51 100 0 128 99 0 5 51 102 0 128 101 0 5 51 104 0 128 103 0 5 51 106 0 128 105 0 5 51 108 0 128 107 0 5 51 110 0 128 109 0 5 51 112 0 128 111 0 5 51 114 0 128 113 0 5 51 116 0 128 115 0 5 51 118 0 128 117 0 5 1 119 0 112 50)))