From cd61c049e39b48db25031b75a933991e7bc209b0 Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 4 Apr 2026 13:00:07 +0000 Subject: [PATCH] vm.sx feature parity: JIT dispatch, active VM tracking, CEK fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing features to lib/vm.sx that sx_vm.ml has: - *active-vm* mutable global for HO primitive callback VM reuse - *jit-compile-fn* platform-settable JIT compilation hook - try-jit-call: check lambda-compiled, attempt JIT, fallback to CEK - vm-call: VmClosure→push-frame, Lambda→try-jit, Component→CEK - vm-call-closure: save/restore *active-vm* around execution - vm-push-frame: refactored to use accessor functions - cek-call-or-suspend: preamble-provided CEK interop Transpiled output (sx_vm_ref.ml) now has 12 functions (was 9): *active-vm*, *jit-compile-fn*, try-jit-call, vm-call, vm-resolve-ho-form, vm-call-external, env-walk, env-walk-set!, vm-run, vm-step, vm-call-closure, vm-execute-module 48 preamble functions (native OCaml type access). Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/bootstrap_vm.py | 4 ++ hosts/ocaml/sx_vm_ref.ml | 18 ++++++-- lib/vm.sx | 81 +++++++++++++++++++++------------ shared/static/wasm/sx/boot.sxbc | 4 +- shared/static/wasm/sx/vm.sx | 81 +++++++++++++++++++++------------ shared/static/wasm/sx/vm.sxbc | 4 +- 6 files changed, 129 insertions(+), 63 deletions(-) diff --git a/hosts/ocaml/bootstrap_vm.py b/hosts/ocaml/bootstrap_vm.py index 71785b04..10f17f40 100644 --- a/hosts/ocaml/bootstrap_vm.py +++ b/hosts/ocaml/bootstrap_vm.py @@ -70,6 +70,10 @@ SKIP = { # Complex native ops "vm-push-frame", "code-from-value", "vm-closure?", "vm-create-closure", + # Lambda accessors (native type) + "lambda?", "lambda-compiled", "lambda-set-compiled!", "lambda-name", + # CEK interop + "cek-call-or-suspend", # Collection helpers (use mutable state + recursion) "collect-n-from-stack", "collect-n-pairs", "pad-n-nils", } diff --git a/hosts/ocaml/sx_vm_ref.ml b/hosts/ocaml/sx_vm_ref.ml index af1acc97..878e0d40 100644 --- a/hosts/ocaml/sx_vm_ref.ml +++ b/hosts/ocaml/sx_vm_ref.ml @@ -137,9 +137,21 @@ let pad_n_nils vm n = Nil (* === Transpiled from lib/vm.sx === *) +(* *active-vm* *) +let rec _active_vm_ = + Nil + +(* *jit-compile-fn* *) +and _jit_compile_fn_ = + Nil + +(* try-jit-call *) +and try_jit_call vm f args = + (let compiled = (lambda_compiled (f)) in (if sx_truthy ((vm_closure_p (compiled))) then (vm_push (vm) ((vm_call_closure (compiled) (args) ((vm_globals_ref (vm)))))) else (if sx_truthy ((prim_call "=" [compiled; (String "jit-failed")])) then (vm_push (vm) ((cek_call_or_suspend (vm) (f) (args)))) else (if sx_truthy ((let _and = _jit_compile_fn_ in if not (sx_truthy _and) then _and else (lambda_name (f)))) then (let () = ignore ((lambda_set_compiled_b (f) ((String "jit-failed")))) in (let result' = (_jit_compile_fn_ (f) ((vm_globals_ref (vm)))) in (if sx_truthy ((vm_closure_p (result'))) then (let () = ignore ((lambda_set_compiled_b (f) (result'))) in (vm_push (vm) ((vm_call_closure (result') (args) ((vm_globals_ref (vm))))))) else (vm_push (vm) ((cek_call_or_suspend (vm) (f) (args))))))) else (vm_push (vm) ((cek_call_or_suspend (vm) (f) (args)))))))) + (* vm-call *) -let rec vm_call vm f args = - (if sx_truthy ((vm_closure_p (f))) then (vm_push_frame (vm) (f) (args)) else (if sx_truthy ((let _or = (prim_call "=" [(type_of (f)); (String "lambda")]) in if sx_truthy _or then _or else (let _or = (prim_call "=" [(type_of (f)); (String "component")]) in if sx_truthy _or then _or else (prim_call "=" [(type_of (f)); (String "island")])))) then (vm_push (vm) ((cek_call (f) (args)))) else (if sx_truthy ((is_callable (f))) then (vm_push (vm) ((sx_apply f args))) else (raise (Eval_error (value_to_str (String (sx_str [(String "VM: not callable: "); (type_of (f))])))))))) +and vm_call vm f args = + (if sx_truthy ((vm_closure_p (f))) then (vm_push_frame (vm) (f) (args)) else (if sx_truthy ((is_lambda (f))) then (try_jit_call (vm) (f) (args)) else (if sx_truthy ((let _or = (prim_call "=" [(type_of (f)); (String "component")]) in if sx_truthy _or then _or else (prim_call "=" [(type_of (f)); (String "island")]))) then (vm_push (vm) ((cek_call_or_suspend (vm) (f) (args)))) else (if sx_truthy ((is_callable (f))) then (vm_push (vm) ((sx_apply f args))) else (raise (Eval_error (value_to_str (String (sx_str [(String "VM: not callable: "); (type_of (f))]))))))))) (* vm-resolve-ho-form *) and vm_resolve_ho_form vm name = @@ -167,7 +179,7 @@ and vm_step vm frame rest_frames bc consts = (* vm-call-closure *) and vm_call_closure closure args globals = - (let vm = (make_vm (globals)) in (let () = ignore ((vm_push_frame (vm) (closure) (args))) in (let () = ignore ((vm_run (vm))) in (vm_pop (vm))))) + let _active_vm_ = ref Nil in (let prev_vm = !_active_vm_ in let vm = (make_vm (globals)) in (let () = ignore ((_active_vm_ := vm; Nil)) in (let () = ignore ((vm_push_frame (vm) (closure) (args))) in (let () = ignore ((vm_run (vm))) in (let () = ignore ((_active_vm_ := prev_vm; Nil)) in (vm_pop (vm))))))) (* vm-execute-module *) and vm_execute_module code globals = diff --git a/lib/vm.sx b/lib/vm.sx index 9a691738..8b62cc4f 100644 --- a/lib/vm.sx +++ b/lib/vm.sx @@ -19,6 +19,14 @@ vm-push-frame code-from-value vm-closure? + *active-vm* + *jit-compile-fn* + lambda? + lambda-compiled + lambda-set-compiled! + lambda-name + cek-call-or-suspend + try-jit-call vm-call frame-local-get frame-local-set @@ -42,8 +50,8 @@ vm-set-frames! vm-globals-ref collect-n-from-stack - pad-n-nils collect-n-pairs + pad-n-nils vm-global-get vm-resolve-ho-form vm-call-external @@ -118,28 +126,12 @@ (fn (vm closure args) (let - ((frame (make-vm-frame closure (get vm "sp")))) + ((frame (make-vm-frame closure (vm-sp vm)))) (for-each (fn (a) (vm-push vm a)) args) - (let - ((arity (len args)) - (total-locals (get (get closure "vm-code") "vc-locals"))) - (let - ((pad-count (- total-locals arity))) - (when - (> pad-count 0) - (let - ((i 0)) - (define - pad-loop - (fn - () - (when - (< i pad-count) - (vm-push vm nil) - (set! i (+ i 1)) - (pad-loop)))) - (pad-loop))))) - (dict-set! vm "frames" (cons frame (get vm "frames")))))) + (pad-n-nils + vm + (- (code-locals (closure-code closure)) (len args))) + (vm-set-frames! vm (cons frame (vm-frames vm)))))) (define code-from-value (fn @@ -157,6 +149,38 @@ (arity (if (nil? arity-raw) 0 arity-raw))) (make-vm-code arity (+ arity 16) bc consts))))) (define vm-closure? (fn (v) (and (dict? v) (has-key? v "vm-code")))) + (define *active-vm* nil) + (define *jit-compile-fn* nil) + (define lambda? (fn (v) (= (type-of v) "lambda"))) + (define lambda-compiled (fn (f) nil)) + (define lambda-set-compiled! (fn (f val) nil)) + (define lambda-name (fn (f) nil)) + (define cek-call-or-suspend (fn (vm f args) (cek-call f args))) + (define + try-jit-call + (fn + (vm f args) + (let + ((compiled (lambda-compiled f))) + (cond + (vm-closure? compiled) + (vm-push vm (vm-call-closure compiled args (vm-globals-ref vm))) + (= compiled :jit-failed) + (vm-push vm (cek-call-or-suspend vm f args)) + (and *jit-compile-fn* (lambda-name f)) + (do + (lambda-set-compiled! f :jit-failed) + (let + ((result (*jit-compile-fn* f (vm-globals-ref vm)))) + (if + (vm-closure? result) + (do + (lambda-set-compiled! f result) + (vm-push + vm + (vm-call-closure result args (vm-globals-ref vm)))) + (vm-push vm (cek-call-or-suspend vm f args))))) + :else (vm-push vm (cek-call-or-suspend vm f args)))))) (define vm-call (fn @@ -164,11 +188,10 @@ (cond (vm-closure? f) (vm-push-frame vm f args) - (or - (= (type-of f) "lambda") - (= (type-of f) "component") - (= (type-of f) "island")) - (vm-push vm (cek-call f args)) + (lambda? f) + (try-jit-call vm f args) + (or (= (type-of f) "component") (= (type-of f) "island")) + (vm-push vm (cek-call-or-suspend vm f args)) (callable? f) (vm-push vm (apply f args)) :else (error (str "VM: not callable: " (type-of f)))))) @@ -580,9 +603,11 @@ (fn (closure args globals) (let - ((vm (make-vm globals))) + ((prev-vm *active-vm*) (vm (make-vm globals))) + (set! *active-vm* vm) (vm-push-frame vm closure args) (vm-run vm) + (set! *active-vm* prev-vm) (vm-pop vm)))) (define vm-execute-module diff --git a/shared/static/wasm/sx/boot.sxbc b/shared/static/wasm/sx/boot.sxbc index 930bb7e7..5b5c5e8e 100644 --- a/shared/static/wasm/sx/boot.sxbc +++ b/shared/static/wasm/sx/boot.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "d482dc6677700a57" +(sxbc 1 "51679a017d907f70" (code - :constants ("HEAD_HOIST_SELECTOR" "meta, title, link[rel='canonical'], script[type='application/ld+json']" "hoist-head-elements-full" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "HEAD_HOIST_SELECTOR" "for-each" {:upvalue-count 0 :arity 1 :constants ("lower" "dom-tag-name" "=" "title" "set-document-title" "dom-text-content" "dom-remove-child" "dom-parent" "meta" "dom-get-attr" "name" "property" "remove-head-element" "str" "meta[name=\"" "\"]" "meta[property=\"" "dom-append-to-head" "link" "rel" "canonical" "link[rel=\"canonical\"]") :bytecode (20 1 0 16 0 48 1 52 0 0 1 17 1 16 1 1 3 0 52 2 0 2 33 30 0 20 4 0 20 5 0 16 0 48 1 48 1 5 20 6 0 20 7 0 16 0 48 1 16 0 49 2 32 205 0 16 1 1 8 0 52 2 0 2 33 103 0 20 9 0 16 0 1 10 0 48 2 17 2 20 9 0 16 0 1 11 0 48 2 17 3 16 2 33 20 0 20 12 0 1 14 0 16 2 1 15 0 52 13 0 3 48 1 32 1 0 2 5 16 3 33 20 0 20 12 0 1 16 0 16 3 1 15 0 52 13 0 3 48 1 32 1 0 2 5 20 6 0 20 7 0 16 0 48 1 16 0 48 2 5 20 17 0 16 0 49 1 32 90 0 16 1 1 18 0 52 2 0 2 6 33 18 0 5 20 9 0 16 0 1 19 0 48 2 1 20 0 52 2 0 2 33 34 0 20 12 0 1 21 0 48 1 5 20 6 0 20 7 0 16 0 48 1 16 0 48 2 5 20 17 0 16 0 49 1 32 22 0 20 6 0 20 7 0 16 0 48 1 16 0 48 2 5 20 17 0 16 0 49 1 50)}) :bytecode (20 0 0 16 0 20 1 0 48 2 17 1 51 3 0 16 1 52 2 0 2 50)} "sx-mount" {:upvalue-count 0 :arity 3 :constants ("resolve-mount-target" "empty?" "dom-child-list" "sx-render-with-env" "dom-set-text-content" "" "dom-append" "hoist-head-elements-full" "process-elements" "sx-hydrate-elements" "sx-hydrate-islands" "run-post-render-hooks") :bytecode (20 0 0 16 0 48 1 17 3 16 3 33 90 0 20 2 0 16 3 48 1 52 1 0 1 33 42 0 20 3 0 16 1 16 2 48 2 17 4 20 4 0 16 3 1 5 0 48 2 5 20 6 0 16 3 16 4 48 2 5 20 7 0 16 3 48 1 32 1 0 2 5 20 8 0 16 3 48 1 5 20 9 0 16 3 48 1 5 20 10 0 16 3 48 1 5 20 11 0 49 0 32 1 0 2 50)} "resolve-suspense" {:upvalue-count 0 :arity 2 :constants ("process-sx-scripts" "dom-query" "str" "[data-suspense=\"" "\"]" "parse" "get-render-env" "dom-set-text-content" "" "for-each" {:upvalue-count 2 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 2 48 3 49 2 50)} "process-elements" "sx-hydrate-elements" "sx-hydrate-islands" "run-post-render-hooks" "dom-dispatch" "sx:resolved" "id" "log-warn" "resolveSuspense: no element for id=") :bytecode (20 0 0 2 48 1 5 20 1 0 1 3 0 16 0 1 4 0 52 2 0 3 48 1 17 2 16 2 33 92 0 16 1 52 5 0 1 17 3 20 6 0 2 48 1 17 4 20 7 0 16 2 1 8 0 48 2 5 51 10 0 1 2 1 4 16 3 52 9 0 2 5 20 11 0 16 2 48 1 5 20 12 0 16 2 48 1 5 20 13 0 16 2 48 1 5 20 14 0 48 0 5 20 15 0 16 2 1 16 0 1 17 0 16 0 65 1 0 49 3 32 14 0 20 18 0 1 19 0 16 0 52 2 0 2 49 1 50)} "sx-hydrate-elements" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "dom-body" "[data-sx]" "for-each" {:upvalue-count 0 :arity 1 :constants ("not" "is-processed?" "hydrated" "mark-processed!" "sx-update-element") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 33 22 0 20 3 0 16 0 1 2 0 48 2 5 20 4 0 16 0 2 49 2 32 1 0 2 50)}) :bytecode (20 0 0 16 0 6 34 6 0 5 20 1 0 48 0 1 2 0 48 2 17 1 51 4 0 16 1 52 3 0 2 50)} "sx-update-element" {:upvalue-count 0 :arity 2 :constants ("resolve-mount-target" "dom-get-attr" "data-sx" "parse-env-attr" "merge-envs" "sx-render-with-env" "dom-set-text-content" "" "dom-append" "store-env-attr") :bytecode (20 0 0 16 0 48 1 17 2 16 2 33 96 0 20 1 0 16 2 1 2 0 48 2 17 3 16 3 33 75 0 20 3 0 16 2 48 1 17 4 20 4 0 16 4 16 1 48 2 17 5 20 5 0 16 3 16 5 48 2 17 6 20 6 0 16 2 1 7 0 48 2 5 20 8 0 16 2 16 6 48 2 5 16 1 33 14 0 20 9 0 16 2 16 4 16 1 49 3 32 1 0 2 32 1 0 2 32 1 0 2 50)} "sx-render-component" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "get-render-env" "env-get" "not" "component?" "error" "Unknown component: " "list" "make-symbol" "for-each" {:upvalue-count 2 :arity 1 :constants ("append!" "make-keyword" "to-kebab" "dict-get") :bytecode (18 0 20 2 0 16 0 48 1 52 1 0 1 52 0 0 2 5 18 0 18 1 16 0 52 3 0 2 52 0 0 2 50)} "keys" "render-to-dom") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 20 3 0 16 2 48 1 17 4 16 4 16 3 52 4 0 2 17 5 16 5 52 6 0 1 52 5 0 1 33 16 0 1 8 0 16 3 52 2 0 2 52 7 0 1 32 40 0 16 3 52 10 0 1 52 9 0 1 17 6 51 12 0 1 6 1 1 16 1 52 13 0 1 52 11 0 2 5 20 14 0 16 6 16 4 2 49 3 50)} "process-sx-scripts" {:upvalue-count 0 :arity 1 :constants ("query-sx-scripts" "for-each" {:upvalue-count 0 :arity 1 :constants ("not" "is-processed?" "script" "mark-processed!" "dom-text-content" "dom-has-attr?" "data-components" "process-component-script" "nil?" "empty?" "trim" "data-init" "sx-parse" "for-each" {:upvalue-count 0 :arity 1 :constants ("cek-eval") :bytecode (20 0 0 16 0 49 1 50)} "data-mount" "dom-get-attr" "dom-query" "sx-mount" "sx-load-components") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 33 173 0 20 3 0 16 0 1 2 0 48 2 5 20 4 0 16 0 48 1 17 1 20 5 0 16 0 1 6 0 48 2 33 12 0 20 7 0 16 0 16 1 49 2 32 125 0 16 1 52 8 0 1 6 34 11 0 5 16 1 52 10 0 1 52 9 0 1 33 4 0 2 32 97 0 20 5 0 16 0 1 11 0 48 2 33 21 0 20 12 0 16 1 48 1 17 2 51 14 0 16 2 52 13 0 2 32 63 0 20 5 0 16 0 1 15 0 48 2 33 43 0 20 16 0 16 0 1 15 0 48 2 17 2 20 17 0 16 2 48 1 17 3 16 3 33 13 0 20 18 0 16 3 16 1 2 49 3 32 1 0 2 32 7 0 20 19 0 16 1 49 1 32 1 0 2 50)}) :bytecode (20 0 0 16 0 48 1 17 1 51 2 0 16 1 52 1 0 2 50)} "process-component-script" {:upvalue-count 0 :arity 2 :constants ("dom-get-attr" "data-hash" "nil?" "not" "empty?" "trim" "sx-load-components" "local-storage-get" "sx-components-hash" "=" "local-storage-set" "sx-components-src" "log-info" "components: downloaded (cookie stale)" "str" "components: cached (" ")" "clear-sx-comp-cookie" "browser-reload" "components: downloaded (" "local-storage-remove" "set-sx-comp-cookie") :bytecode (20 0 0 16 0 1 1 0 48 2 17 2 16 2 52 2 0 1 33 38 0 16 1 6 33 15 0 5 16 1 52 5 0 1 52 4 0 1 52 3 0 1 33 10 0 20 6 0 16 1 49 1 32 1 0 2 32 239 0 16 1 6 33 15 0 5 16 1 52 5 0 1 52 4 0 1 52 3 0 1 17 3 20 7 0 1 8 0 48 1 17 4 16 4 16 2 52 9 0 2 33 103 0 16 3 33 41 0 20 10 0 1 8 0 16 2 48 2 5 20 10 0 1 11 0 16 1 48 2 5 20 6 0 16 1 48 1 5 20 12 0 1 13 0 48 1 32 54 0 20 7 0 1 11 0 48 1 17 5 16 5 33 28 0 20 6 0 16 5 48 1 5 20 12 0 1 15 0 16 2 1 16 0 52 14 0 3 48 1 32 11 0 20 17 0 48 0 5 20 18 0 48 0 32 84 0 16 3 33 50 0 20 10 0 1 8 0 16 2 48 2 5 20 10 0 1 11 0 16 1 48 2 5 20 6 0 16 1 48 1 5 20 12 0 1 19 0 16 2 1 16 0 52 14 0 3 48 1 32 29 0 20 20 0 1 8 0 48 1 5 20 20 0 1 11 0 48 1 5 20 17 0 48 0 5 20 18 0 48 0 5 20 21 0 16 2 49 1 50)} "_page-routes" "list" "process-page-scripts" {:upvalue-count 0 :arity 0 :constants ("query-page-scripts" "log-info" "str" "pages: found " "len" " script tags" "for-each" {:upvalue-count 0 :arity 1 :constants ("not" "is-processed?" "pages" "mark-processed!" "dom-text-content" "log-info" "str" "pages: script text length=" "len" 0 "empty?" "trim" "parse" "pages: parsed " " entries" "for-each" {:upvalue-count 0 :arity 1 :constants ("append!" "_page-routes" "merge" "parsed" "parse-route-pattern" "get" "path") :bytecode (20 1 0 16 0 1 3 0 20 4 0 16 0 1 6 0 52 5 0 2 48 1 65 1 0 52 2 0 2 52 0 0 2 50)} "log-warn" "pages: script tag is empty") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 33 127 0 20 3 0 16 0 1 2 0 48 2 5 20 4 0 16 0 48 1 17 1 20 5 0 1 7 0 16 1 33 9 0 16 1 52 8 0 1 32 3 0 1 9 0 52 6 0 2 48 1 5 16 1 6 33 15 0 5 16 1 52 11 0 1 52 10 0 1 52 0 0 1 33 42 0 16 1 52 12 0 1 17 2 20 5 0 1 13 0 16 2 52 8 0 1 1 14 0 52 6 0 3 48 1 5 51 16 0 16 2 52 15 0 2 32 8 0 20 17 0 1 18 0 49 1 32 1 0 2 50)} "pages: " "_page-routes" " routes loaded") :bytecode (20 0 0 48 0 17 0 20 1 0 1 3 0 16 0 52 4 0 1 1 5 0 52 2 0 3 48 1 5 51 7 0 16 0 52 6 0 2 5 20 1 0 1 8 0 20 9 0 52 4 0 1 1 10 0 52 2 0 3 49 1 50)} "sx-hydrate-islands" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "dom-body" "[data-sx-island]" "log-info" "str" "sx-hydrate-islands: " "len" " island(s) in " "subtree" "document" "for-each" {:upvalue-count 0 :arity 1 :constants ("is-processed?" "island-hydrated" "log-info" "str" " skip (already hydrated): " "dom-get-attr" "data-sx-island" " hydrating: " "mark-processed!" "hydrate-island") :bytecode (20 0 0 16 0 1 1 0 48 2 33 25 0 20 2 0 1 4 0 20 5 0 16 0 1 6 0 48 2 52 3 0 2 49 1 32 41 0 20 2 0 1 7 0 20 5 0 16 0 1 6 0 48 2 52 3 0 2 48 1 5 20 8 0 16 0 1 1 0 48 2 5 20 9 0 16 0 49 1 50)}) :bytecode (20 0 0 16 0 6 34 6 0 5 20 1 0 48 0 1 2 0 48 2 17 1 20 3 0 1 5 0 16 1 52 6 0 1 1 7 0 16 0 33 6 0 1 8 0 32 3 0 1 9 0 52 4 0 4 48 1 5 51 11 0 16 1 52 10 0 2 50)} "hydrate-island" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "data-sx-island" "data-sx-state" "{}" "str" "~" "get-render-env" "env-get" "not" "component?" "island?" "log-warn" "hydrate-island: unknown island " "first" "sx-parse" "list" "env-merge" "component-closure" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-bind!" "dict-has?" "dict-get") :bytecode (18 0 16 0 18 1 16 0 52 1 0 2 33 11 0 18 1 16 0 52 2 0 2 32 1 0 2 52 0 0 3 50)} "component-params" "cek-try" {:upvalue-count 3 :arity 0 :constants ("with-island-scope" {:upvalue-count 1 :arity 1 :constants ("append!") :bytecode (18 0 16 0 52 0 0 2 50)} {:upvalue-count 2 :arity 0 :constants ("render-to-dom" "component-body") :bytecode (20 0 0 18 0 52 1 0 1 18 1 2 49 3 50)}) :bytecode (20 0 0 51 1 0 0 0 51 2 0 0 1 0 2 49 2 50)} {:upvalue-count 1 :arity 1 :constants ("log-warn" "str" "hydrate-island FAILED: " " — " "dom-create-element" "div" "dom-set-attr" "class" "sx-island-error" "style" "padding:8px;margin:4px 0;border:1px solid #ef4444;border-radius:4px;background:#fef2f2;color:#b91c1c;font-family:monospace;font-size:12px;white-space:pre-wrap" "dom-set-text-content" "Island error: " "\n") :bytecode (20 0 0 1 2 0 18 0 1 3 0 16 0 52 1 0 4 48 1 5 20 4 0 1 5 0 2 48 2 17 1 20 6 0 16 1 1 7 0 1 8 0 48 3 5 20 6 0 16 1 1 9 0 1 10 0 48 3 5 20 11 0 16 1 1 12 0 18 0 1 13 0 16 0 52 1 0 4 48 2 5 16 1 50)} "dom-set-text-content" "" "dom-append" "dom-set-data" "sx-disposers" "set-timeout" {:upvalue-count 1 :arity 0 :constants ("process-elements") :bytecode (20 0 0 18 0 49 1 50)} 0 "log-info" "hydrated island: " " (" "len" " disposers)") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 20 0 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 17 2 1 5 0 16 1 52 4 0 2 17 3 20 6 0 2 48 1 17 4 16 4 16 3 52 7 0 2 17 5 16 5 52 9 0 1 6 34 7 0 5 16 5 52 10 0 1 52 8 0 1 33 17 0 20 11 0 1 12 0 16 3 52 4 0 2 49 1 32 153 0 20 14 0 16 2 48 1 52 13 0 1 6 34 4 0 5 65 0 0 17 6 52 15 0 0 17 7 16 5 52 17 0 1 16 4 52 16 0 2 17 8 51 19 0 1 8 1 6 16 5 52 20 0 1 52 18 0 2 5 51 22 0 1 7 1 5 1 8 51 23 0 1 3 52 21 0 2 17 9 20 24 0 16 0 1 25 0 48 2 5 20 26 0 16 0 16 9 48 2 5 20 27 0 16 0 1 28 0 16 7 48 3 5 20 29 0 51 30 0 1 0 1 31 0 48 2 5 20 32 0 1 33 0 16 3 1 34 0 16 7 52 35 0 1 1 36 0 52 4 0 5 49 1 50)} "dispose-island" {:upvalue-count 0 :arity 1 :constants ("dom-get-data" "sx-disposers" "for-each" {:upvalue-count 0 :arity 1 :constants ("callable?") :bytecode (20 0 0 16 0 48 1 33 7 0 16 0 49 0 32 1 0 2 50)} "dom-set-data" "clear-processed!" "island-hydrated") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 24 0 51 3 0 16 1 52 2 0 2 5 20 4 0 16 0 1 1 0 2 48 3 32 1 0 2 5 20 5 0 16 0 1 6 0 49 2 50)} "dispose-islands-in" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "[data-sx-island]" "not" "empty?" "filter" {:upvalue-count 0 :arity 1 :constants ("not" "is-processed?" "island-hydrated") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 50)} "log-info" "str" "disposing " "len" " island(s)" "for-each" "dispose-island") :bytecode (16 0 33 98 0 20 0 0 16 0 1 1 0 48 2 17 1 16 1 6 33 11 0 5 16 1 52 3 0 1 52 2 0 1 33 62 0 51 5 0 16 1 52 4 0 2 17 2 16 2 52 3 0 1 52 2 0 1 33 34 0 20 6 0 1 8 0 16 2 52 9 0 1 1 10 0 52 7 0 3 48 1 5 20 12 0 16 2 52 11 0 2 32 1 0 2 32 1 0 2 32 1 0 2 50)} "force-dispose-islands-in" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "[data-sx-island]" "not" "empty?" "log-info" "str" "force-disposing " "len" " island(s)" "for-each" "dispose-island") :bytecode (16 0 33 70 0 20 0 0 16 0 1 1 0 48 2 17 1 16 1 6 33 11 0 5 16 1 52 3 0 1 52 2 0 1 33 34 0 20 4 0 1 6 0 16 1 52 7 0 1 1 8 0 52 5 0 3 48 1 5 20 10 0 16 1 52 9 0 2 32 1 0 2 32 1 0 2 50)} "*pre-render-hooks*" "*post-render-hooks*" "register-pre-render-hook" {:upvalue-count 0 :arity 1 :constants ("append!" "*pre-render-hooks*") :bytecode (20 1 0 16 0 52 0 0 2 50)} "register-post-render-hook" {:upvalue-count 0 :arity 1 :constants ("append!" "*post-render-hooks*") :bytecode (20 1 0 16 0 52 0 0 2 50)} "run-pre-render-hooks" {:upvalue-count 0 :arity 0 :constants ("for-each" {:upvalue-count 0 :arity 1 :constants ("cek-call") :bytecode (16 0 2 52 0 0 2 50)} "*pre-render-hooks*") :bytecode (51 1 0 20 2 0 52 0 0 2 50)} "run-post-render-hooks" {:upvalue-count 0 :arity 0 :constants ("log-info" "str" "run-post-render-hooks: " "len" "*post-render-hooks*" " hooks" "for-each" {:upvalue-count 0 :arity 1 :constants ("log-info" "str" " hook type: " "type-of" " callable: " "callable?" " lambda: " "lambda?" "cek-call") :bytecode (20 0 0 1 2 0 16 0 52 3 0 1 1 4 0 20 5 0 16 0 48 1 1 6 0 16 0 52 7 0 1 52 1 0 6 48 1 5 16 0 2 52 8 0 2 50)} "flush-collected-styles") :bytecode (20 0 0 1 2 0 20 4 0 52 3 0 1 1 5 0 52 1 0 3 48 1 5 51 7 0 20 4 0 52 6 0 2 5 20 8 0 49 0 50)} "boot-init" {:upvalue-count 0 :arity 0 :constants ("log-info" "str" "sx-browser " "SX_VERSION" "process-page-scripts" "process-sx-scripts" "sx-hydrate-elements" "sx-hydrate-islands" "run-post-render-hooks" "flush-collected-styles" "set-timeout" {:upvalue-count 0 :arity 0 :constants ("process-elements") :bytecode (20 0 0 2 49 1 50)} 0 "dom-set-attr" "host-get" "dom-document" "documentElement" "data-sx-ready" "true" "dom-dispatch" "sx:ready") :bytecode (20 0 0 1 2 0 20 3 0 52 1 0 2 48 1 5 20 4 0 48 0 5 20 5 0 2 48 1 5 20 6 0 2 48 1 5 20 7 0 2 48 1 5 20 8 0 48 0 5 20 9 0 48 0 5 20 10 0 51 11 0 1 12 0 48 2 5 20 13 0 20 14 0 20 15 0 48 0 1 16 0 48 2 1 17 0 1 18 0 48 3 5 20 19 0 20 15 0 48 0 1 20 0 2 48 3 5 20 0 0 1 20 0 49 1 50)}) :bytecode (1 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 52 19 0 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 52 19 0 0 128 32 0 5 52 19 0 0 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 41 0 128 40 0 5 51 43 0 128 42 0 50))) + :constants ({:library (sx dom) :op "import"} {:library (sx bytecode) :op "import"} {:library (sx browser) :op "import"} {:library (web boot-helpers) :op "import"} {:library (web adapter-dom) :op "import"} {:library (sx signals) :op "import"} {:library (sx signals-web) :op "import"} {:library (web router) :op "import"} {:library (web orchestration) :op "import"} {:library (sx render) :op "import"} "HEAD_HOIST_SELECTOR" "meta, title, link[rel='canonical'], script[type='application/ld+json']" "hoist-head-elements-full" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "HEAD_HOIST_SELECTOR" "for-each" {:upvalue-count 0 :arity 1 :constants ("lower" "dom-tag-name" "=" "title" "set-document-title" "dom-text-content" "dom-remove-child" "dom-parent" "meta" "dom-get-attr" "name" "property" "remove-head-element" "str" "meta[name=\"" "\"]" "meta[property=\"" "dom-append-to-head" "link" "rel" "canonical" "link[rel=\"canonical\"]") :bytecode (20 1 0 16 0 48 1 52 0 0 1 17 1 16 1 1 3 0 52 2 0 2 33 30 0 20 4 0 20 5 0 16 0 48 1 48 1 5 20 6 0 20 7 0 16 0 48 1 16 0 49 2 32 205 0 16 1 1 8 0 52 2 0 2 33 103 0 20 9 0 16 0 1 10 0 48 2 17 2 20 9 0 16 0 1 11 0 48 2 17 3 16 2 33 20 0 20 12 0 1 14 0 16 2 1 15 0 52 13 0 3 48 1 32 1 0 2 5 16 3 33 20 0 20 12 0 1 16 0 16 3 1 15 0 52 13 0 3 48 1 32 1 0 2 5 20 6 0 20 7 0 16 0 48 1 16 0 48 2 5 20 17 0 16 0 49 1 32 90 0 16 1 1 18 0 52 2 0 2 6 33 18 0 5 20 9 0 16 0 1 19 0 48 2 1 20 0 52 2 0 2 33 34 0 20 12 0 1 21 0 48 1 5 20 6 0 20 7 0 16 0 48 1 16 0 48 2 5 20 17 0 16 0 49 1 32 22 0 20 6 0 20 7 0 16 0 48 1 16 0 48 2 5 20 17 0 16 0 49 1 50)}) :bytecode (20 0 0 16 0 20 1 0 48 2 17 1 51 3 0 16 1 52 2 0 2 50)} "sx-mount" {:upvalue-count 0 :arity 3 :constants ("resolve-mount-target" "empty?" "dom-child-list" "sx-render-with-env" "dom-set-text-content" "" "dom-append" "hoist-head-elements-full" "process-elements" "sx-hydrate-elements" "sx-hydrate-islands" "run-post-render-hooks") :bytecode (20 0 0 16 0 48 1 17 3 16 3 33 90 0 20 2 0 16 3 48 1 52 1 0 1 33 42 0 20 3 0 16 1 16 2 48 2 17 4 20 4 0 16 3 1 5 0 48 2 5 20 6 0 16 3 16 4 48 2 5 20 7 0 16 3 48 1 32 1 0 2 5 20 8 0 16 3 48 1 5 20 9 0 16 3 48 1 5 20 10 0 16 3 48 1 5 20 11 0 49 0 32 1 0 2 50)} "resolve-suspense" {:upvalue-count 0 :arity 2 :constants ("process-sx-scripts" "dom-query" "str" "[data-suspense=\"" "\"]" "parse" "get-render-env" "dom-set-text-content" "" "for-each" {:upvalue-count 2 :arity 1 :constants ("dom-append" "render-to-dom") :bytecode (20 0 0 18 0 20 1 0 16 0 18 1 2 48 3 49 2 50)} "process-elements" "sx-hydrate-elements" "sx-hydrate-islands" "run-post-render-hooks" "dom-dispatch" "sx:resolved" "id" "log-warn" "resolveSuspense: no element for id=") :bytecode (20 0 0 2 48 1 5 20 1 0 1 3 0 16 0 1 4 0 52 2 0 3 48 1 17 2 16 2 33 92 0 16 1 52 5 0 1 17 3 20 6 0 2 48 1 17 4 20 7 0 16 2 1 8 0 48 2 5 51 10 0 1 2 1 4 16 3 52 9 0 2 5 20 11 0 16 2 48 1 5 20 12 0 16 2 48 1 5 20 13 0 16 2 48 1 5 20 14 0 48 0 5 20 15 0 16 2 1 16 0 1 17 0 16 0 65 1 0 49 3 32 14 0 20 18 0 1 19 0 16 0 52 2 0 2 49 1 50)} "sx-hydrate-elements" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "dom-body" "[data-sx]" "for-each" {:upvalue-count 0 :arity 1 :constants ("not" "is-processed?" "hydrated" "mark-processed!" "sx-update-element") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 33 22 0 20 3 0 16 0 1 2 0 48 2 5 20 4 0 16 0 2 49 2 32 1 0 2 50)}) :bytecode (20 0 0 16 0 6 34 6 0 5 20 1 0 48 0 1 2 0 48 2 17 1 51 4 0 16 1 52 3 0 2 50)} "sx-update-element" {:upvalue-count 0 :arity 2 :constants ("resolve-mount-target" "dom-get-attr" "data-sx" "parse-env-attr" "merge-envs" "sx-render-with-env" "dom-set-text-content" "" "dom-append" "store-env-attr") :bytecode (20 0 0 16 0 48 1 17 2 16 2 33 96 0 20 1 0 16 2 1 2 0 48 2 17 3 16 3 33 75 0 20 3 0 16 2 48 1 17 4 20 4 0 16 4 16 1 48 2 17 5 20 5 0 16 3 16 5 48 2 17 6 20 6 0 16 2 1 7 0 48 2 5 20 8 0 16 2 16 6 48 2 5 16 1 33 14 0 20 9 0 16 2 16 4 16 1 49 3 32 1 0 2 32 1 0 2 32 1 0 2 50)} "sx-render-component" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "get-render-env" "env-get" "not" "component?" "error" "Unknown component: " "list" "make-symbol" "for-each" {:upvalue-count 2 :arity 1 :constants ("append!" "make-keyword" "to-kebab" "dict-get") :bytecode (18 0 20 2 0 16 0 48 1 52 1 0 1 52 0 0 2 5 18 0 18 1 16 0 52 3 0 2 52 0 0 2 50)} "keys" "render-to-dom") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 20 3 0 16 2 48 1 17 4 16 4 16 3 52 4 0 2 17 5 16 5 52 6 0 1 52 5 0 1 33 16 0 1 8 0 16 3 52 2 0 2 52 7 0 1 32 40 0 16 3 52 10 0 1 52 9 0 1 17 6 51 12 0 1 6 1 1 16 1 52 13 0 1 52 11 0 2 5 20 14 0 16 6 16 4 2 49 3 50)} "process-sx-scripts" {:upvalue-count 0 :arity 1 :constants ("query-sx-scripts" "for-each" {:upvalue-count 0 :arity 1 :constants ("not" "is-processed?" "script" "mark-processed!" "dom-text-content" "dom-has-attr?" "data-components" "process-component-script" "nil?" "empty?" "trim" "data-init" "sx-parse" "for-each" {:upvalue-count 0 :arity 1 :constants ("cek-eval") :bytecode (20 0 0 16 0 49 1 50)} "data-mount" "dom-get-attr" "dom-query" "sx-mount" "sx-load-components") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 33 173 0 20 3 0 16 0 1 2 0 48 2 5 20 4 0 16 0 48 1 17 1 20 5 0 16 0 1 6 0 48 2 33 12 0 20 7 0 16 0 16 1 49 2 32 125 0 16 1 52 8 0 1 6 34 11 0 5 16 1 52 10 0 1 52 9 0 1 33 4 0 2 32 97 0 20 5 0 16 0 1 11 0 48 2 33 21 0 20 12 0 16 1 48 1 17 2 51 14 0 16 2 52 13 0 2 32 63 0 20 5 0 16 0 1 15 0 48 2 33 43 0 20 16 0 16 0 1 15 0 48 2 17 2 20 17 0 16 2 48 1 17 3 16 3 33 13 0 20 18 0 16 3 16 1 2 49 3 32 1 0 2 32 7 0 20 19 0 16 1 49 1 32 1 0 2 50)}) :bytecode (20 0 0 16 0 48 1 17 1 51 2 0 16 1 52 1 0 2 50)} "process-component-script" {:upvalue-count 0 :arity 2 :constants ("dom-get-attr" "data-hash" "nil?" "not" "empty?" "trim" "sx-load-components" "local-storage-get" "sx-components-hash" "=" "local-storage-set" "sx-components-src" "log-info" "components: downloaded (cookie stale)" "str" "components: cached (" ")" "clear-sx-comp-cookie" "browser-reload" "components: downloaded (" "local-storage-remove" "set-sx-comp-cookie") :bytecode (20 0 0 16 0 1 1 0 48 2 17 2 16 2 52 2 0 1 33 38 0 16 1 6 33 15 0 5 16 1 52 5 0 1 52 4 0 1 52 3 0 1 33 10 0 20 6 0 16 1 49 1 32 1 0 2 32 239 0 16 1 6 33 15 0 5 16 1 52 5 0 1 52 4 0 1 52 3 0 1 17 3 20 7 0 1 8 0 48 1 17 4 16 4 16 2 52 9 0 2 33 103 0 16 3 33 41 0 20 10 0 1 8 0 16 2 48 2 5 20 10 0 1 11 0 16 1 48 2 5 20 6 0 16 1 48 1 5 20 12 0 1 13 0 48 1 32 54 0 20 7 0 1 11 0 48 1 17 5 16 5 33 28 0 20 6 0 16 5 48 1 5 20 12 0 1 15 0 16 2 1 16 0 52 14 0 3 48 1 32 11 0 20 17 0 48 0 5 20 18 0 48 0 32 84 0 16 3 33 50 0 20 10 0 1 8 0 16 2 48 2 5 20 10 0 1 11 0 16 1 48 2 5 20 6 0 16 1 48 1 5 20 12 0 1 19 0 16 2 1 16 0 52 14 0 3 48 1 32 29 0 20 20 0 1 8 0 48 1 5 20 20 0 1 11 0 48 1 5 20 17 0 48 0 5 20 18 0 48 0 5 20 21 0 16 2 49 1 50)} "_page-routes" "list" "process-page-scripts" {:upvalue-count 0 :arity 0 :constants ("query-page-scripts" "log-info" "str" "pages: found " "len" " script tags" "for-each" {:upvalue-count 0 :arity 1 :constants ("not" "is-processed?" "pages" "mark-processed!" "dom-text-content" "log-info" "str" "pages: script text length=" "len" 0 "empty?" "trim" "parse" "pages: parsed " " entries" "for-each" {:upvalue-count 0 :arity 1 :constants ("append!" "_page-routes" "merge" "parsed" "parse-route-pattern" "get" "path") :bytecode (20 1 0 16 0 1 3 0 20 4 0 16 0 1 6 0 52 5 0 2 48 1 65 1 0 52 2 0 2 52 0 0 2 50)} "log-warn" "pages: script tag is empty") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 33 127 0 20 3 0 16 0 1 2 0 48 2 5 20 4 0 16 0 48 1 17 1 20 5 0 1 7 0 16 1 33 9 0 16 1 52 8 0 1 32 3 0 1 9 0 52 6 0 2 48 1 5 16 1 6 33 15 0 5 16 1 52 11 0 1 52 10 0 1 52 0 0 1 33 42 0 16 1 52 12 0 1 17 2 20 5 0 1 13 0 16 2 52 8 0 1 1 14 0 52 6 0 3 48 1 5 51 16 0 16 2 52 15 0 2 32 8 0 20 17 0 1 18 0 49 1 32 1 0 2 50)} "pages: " "_page-routes" " routes loaded") :bytecode (20 0 0 48 0 17 0 20 1 0 1 3 0 16 0 52 4 0 1 1 5 0 52 2 0 3 48 1 5 51 7 0 16 0 52 6 0 2 5 20 1 0 1 8 0 20 9 0 52 4 0 1 1 10 0 52 2 0 3 49 1 50)} "sx-hydrate-islands" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "dom-body" "[data-sx-island]" "log-info" "str" "sx-hydrate-islands: " "len" " island(s) in " "subtree" "document" "for-each" {:upvalue-count 0 :arity 1 :constants ("is-processed?" "island-hydrated" "log-info" "str" " skip (already hydrated): " "dom-get-attr" "data-sx-island" " hydrating: " "mark-processed!" "hydrate-island") :bytecode (20 0 0 16 0 1 1 0 48 2 33 25 0 20 2 0 1 4 0 20 5 0 16 0 1 6 0 48 2 52 3 0 2 49 1 32 41 0 20 2 0 1 7 0 20 5 0 16 0 1 6 0 48 2 52 3 0 2 48 1 5 20 8 0 16 0 1 1 0 48 2 5 20 9 0 16 0 49 1 50)}) :bytecode (20 0 0 16 0 6 34 6 0 5 20 1 0 48 0 1 2 0 48 2 17 1 20 3 0 1 5 0 16 1 52 6 0 1 1 7 0 16 0 33 6 0 1 8 0 32 3 0 1 9 0 52 4 0 4 48 1 5 51 11 0 16 1 52 10 0 2 50)} "hydrate-island" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "data-sx-island" "data-sx-state" "{}" "str" "~" "get-render-env" "env-get" "not" "component?" "island?" "log-warn" "hydrate-island: unknown island " "first" "sx-parse" "list" "env-merge" "component-closure" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-bind!" "dict-has?" "dict-get") :bytecode (18 0 16 0 18 1 16 0 52 1 0 2 33 11 0 18 1 16 0 52 2 0 2 32 1 0 2 52 0 0 3 50)} "component-params" "cek-try" {:upvalue-count 3 :arity 0 :constants ("with-island-scope" {:upvalue-count 1 :arity 1 :constants ("append!") :bytecode (18 0 16 0 52 0 0 2 50)} {:upvalue-count 2 :arity 0 :constants ("render-to-dom" "component-body") :bytecode (20 0 0 18 0 52 1 0 1 18 1 2 49 3 50)}) :bytecode (20 0 0 51 1 0 0 0 51 2 0 0 1 0 2 49 2 50)} {:upvalue-count 1 :arity 1 :constants ("log-warn" "str" "hydrate-island FAILED: " " — " "dom-create-element" "div" "dom-set-attr" "class" "sx-island-error" "style" "padding:8px;margin:4px 0;border:1px solid #ef4444;border-radius:4px;background:#fef2f2;color:#b91c1c;font-family:monospace;font-size:12px;white-space:pre-wrap" "dom-set-text-content" "Island error: " "\n") :bytecode (20 0 0 1 2 0 18 0 1 3 0 16 0 52 1 0 4 48 1 5 20 4 0 1 5 0 2 48 2 17 1 20 6 0 16 1 1 7 0 1 8 0 48 3 5 20 6 0 16 1 1 9 0 1 10 0 48 3 5 20 11 0 16 1 1 12 0 18 0 1 13 0 16 0 52 1 0 4 48 2 5 16 1 50)} "dom-set-text-content" "" "dom-append" "dom-set-data" "sx-disposers" "set-timeout" {:upvalue-count 1 :arity 0 :constants ("process-elements") :bytecode (20 0 0 18 0 49 1 50)} 0 "log-info" "hydrated island: " " (" "len" " disposers)") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 20 0 0 16 0 1 2 0 48 2 6 34 4 0 5 1 3 0 17 2 1 5 0 16 1 52 4 0 2 17 3 20 6 0 2 48 1 17 4 16 4 16 3 52 7 0 2 17 5 16 5 52 9 0 1 6 34 7 0 5 16 5 52 10 0 1 52 8 0 1 33 17 0 20 11 0 1 12 0 16 3 52 4 0 2 49 1 32 153 0 20 14 0 16 2 48 1 52 13 0 1 6 34 4 0 5 65 0 0 17 6 52 15 0 0 17 7 16 5 52 17 0 1 16 4 52 16 0 2 17 8 51 19 0 1 8 1 6 16 5 52 20 0 1 52 18 0 2 5 51 22 0 1 7 1 5 1 8 51 23 0 1 3 52 21 0 2 17 9 20 24 0 16 0 1 25 0 48 2 5 20 26 0 16 0 16 9 48 2 5 20 27 0 16 0 1 28 0 16 7 48 3 5 20 29 0 51 30 0 1 0 1 31 0 48 2 5 20 32 0 1 33 0 16 3 1 34 0 16 7 52 35 0 1 1 36 0 52 4 0 5 49 1 50)} "dispose-island" {:upvalue-count 0 :arity 1 :constants ("dom-get-data" "sx-disposers" "for-each" {:upvalue-count 0 :arity 1 :constants ("callable?") :bytecode (20 0 0 16 0 48 1 33 7 0 16 0 49 0 32 1 0 2 50)} "dom-set-data" "clear-processed!" "island-hydrated") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 24 0 51 3 0 16 1 52 2 0 2 5 20 4 0 16 0 1 1 0 2 48 3 32 1 0 2 5 20 5 0 16 0 1 6 0 49 2 50)} "dispose-islands-in" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "[data-sx-island]" "not" "empty?" "filter" {:upvalue-count 0 :arity 1 :constants ("not" "is-processed?" "island-hydrated") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 50)} "log-info" "str" "disposing " "len" " island(s)" "for-each" "dispose-island") :bytecode (16 0 33 98 0 20 0 0 16 0 1 1 0 48 2 17 1 16 1 6 33 11 0 5 16 1 52 3 0 1 52 2 0 1 33 62 0 51 5 0 16 1 52 4 0 2 17 2 16 2 52 3 0 1 52 2 0 1 33 34 0 20 6 0 1 8 0 16 2 52 9 0 1 1 10 0 52 7 0 3 48 1 5 20 12 0 16 2 52 11 0 2 32 1 0 2 32 1 0 2 32 1 0 2 50)} "force-dispose-islands-in" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "[data-sx-island]" "not" "empty?" "log-info" "str" "force-disposing " "len" " island(s)" "for-each" "dispose-island") :bytecode (16 0 33 70 0 20 0 0 16 0 1 1 0 48 2 17 1 16 1 6 33 11 0 5 16 1 52 3 0 1 52 2 0 1 33 34 0 20 4 0 1 6 0 16 1 52 7 0 1 1 8 0 52 5 0 3 48 1 5 20 10 0 16 1 52 9 0 2 32 1 0 2 32 1 0 2 50)} "*pre-render-hooks*" "*post-render-hooks*" "register-pre-render-hook" {:upvalue-count 0 :arity 1 :constants ("append!" "*pre-render-hooks*") :bytecode (20 1 0 16 0 52 0 0 2 50)} "register-post-render-hook" {:upvalue-count 0 :arity 1 :constants ("append!" "*post-render-hooks*") :bytecode (20 1 0 16 0 52 0 0 2 50)} "run-pre-render-hooks" {:upvalue-count 0 :arity 0 :constants ("for-each" {:upvalue-count 0 :arity 1 :constants ("cek-call") :bytecode (16 0 2 52 0 0 2 50)} "*pre-render-hooks*") :bytecode (51 1 0 20 2 0 52 0 0 2 50)} "run-post-render-hooks" {:upvalue-count 0 :arity 0 :constants ("log-info" "str" "run-post-render-hooks: " "len" "*post-render-hooks*" " hooks" "for-each" {:upvalue-count 0 :arity 1 :constants ("log-info" "str" " hook type: " "type-of" " callable: " "callable?" " lambda: " "lambda?" "cek-call") :bytecode (20 0 0 1 2 0 16 0 52 3 0 1 1 4 0 20 5 0 16 0 48 1 1 6 0 16 0 52 7 0 1 52 1 0 6 48 1 5 16 0 2 52 8 0 2 50)} "flush-collected-styles") :bytecode (20 0 0 1 2 0 20 4 0 52 3 0 1 1 5 0 52 1 0 3 48 1 5 51 7 0 20 4 0 52 6 0 2 5 20 8 0 49 0 50)} "boot-init" {:upvalue-count 0 :arity 0 :constants ("log-info" "str" "sx-browser " "SX_VERSION" "process-page-scripts" "process-sx-scripts" "sx-hydrate-elements" "sx-hydrate-islands" "run-post-render-hooks" "flush-collected-styles" "set-timeout" {:upvalue-count 0 :arity 0 :constants ("process-elements") :bytecode (20 0 0 2 49 1 50)} 0 "dom-set-attr" "host-get" "dom-document" "documentElement" "data-sx-ready" "true" "dom-dispatch" "sx:ready") :bytecode (20 0 0 1 2 0 20 3 0 52 1 0 2 48 1 5 20 4 0 48 0 5 20 5 0 2 48 1 5 20 6 0 2 48 1 5 20 7 0 2 48 1 5 20 8 0 48 0 5 20 9 0 48 0 5 20 10 0 51 11 0 1 12 0 48 2 5 20 13 0 20 14 0 20 15 0 48 0 1 16 0 48 2 1 17 0 1 18 0 48 3 5 20 19 0 20 15 0 48 0 1 20 0 2 48 3 5 20 0 0 1 20 0 49 1 50)}) :bytecode (1 0 0 112 5 2 5 1 1 0 112 5 2 5 1 2 0 112 5 2 5 1 3 0 112 5 2 5 1 4 0 112 5 2 5 1 5 0 112 5 2 5 1 6 0 112 5 2 5 1 7 0 112 5 2 5 1 8 0 112 5 2 5 1 9 0 112 5 2 5 1 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 52 29 0 0 128 28 0 5 51 31 0 128 30 0 5 51 33 0 128 32 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 41 0 128 40 0 5 52 29 0 0 128 42 0 5 52 29 0 0 128 43 0 5 51 45 0 128 44 0 5 51 47 0 128 46 0 5 51 49 0 128 48 0 5 51 51 0 128 50 0 5 51 53 0 128 52 0 50))) diff --git a/shared/static/wasm/sx/vm.sx b/shared/static/wasm/sx/vm.sx index 9a691738..8b62cc4f 100644 --- a/shared/static/wasm/sx/vm.sx +++ b/shared/static/wasm/sx/vm.sx @@ -19,6 +19,14 @@ vm-push-frame code-from-value vm-closure? + *active-vm* + *jit-compile-fn* + lambda? + lambda-compiled + lambda-set-compiled! + lambda-name + cek-call-or-suspend + try-jit-call vm-call frame-local-get frame-local-set @@ -42,8 +50,8 @@ vm-set-frames! vm-globals-ref collect-n-from-stack - pad-n-nils collect-n-pairs + pad-n-nils vm-global-get vm-resolve-ho-form vm-call-external @@ -118,28 +126,12 @@ (fn (vm closure args) (let - ((frame (make-vm-frame closure (get vm "sp")))) + ((frame (make-vm-frame closure (vm-sp vm)))) (for-each (fn (a) (vm-push vm a)) args) - (let - ((arity (len args)) - (total-locals (get (get closure "vm-code") "vc-locals"))) - (let - ((pad-count (- total-locals arity))) - (when - (> pad-count 0) - (let - ((i 0)) - (define - pad-loop - (fn - () - (when - (< i pad-count) - (vm-push vm nil) - (set! i (+ i 1)) - (pad-loop)))) - (pad-loop))))) - (dict-set! vm "frames" (cons frame (get vm "frames")))))) + (pad-n-nils + vm + (- (code-locals (closure-code closure)) (len args))) + (vm-set-frames! vm (cons frame (vm-frames vm)))))) (define code-from-value (fn @@ -157,6 +149,38 @@ (arity (if (nil? arity-raw) 0 arity-raw))) (make-vm-code arity (+ arity 16) bc consts))))) (define vm-closure? (fn (v) (and (dict? v) (has-key? v "vm-code")))) + (define *active-vm* nil) + (define *jit-compile-fn* nil) + (define lambda? (fn (v) (= (type-of v) "lambda"))) + (define lambda-compiled (fn (f) nil)) + (define lambda-set-compiled! (fn (f val) nil)) + (define lambda-name (fn (f) nil)) + (define cek-call-or-suspend (fn (vm f args) (cek-call f args))) + (define + try-jit-call + (fn + (vm f args) + (let + ((compiled (lambda-compiled f))) + (cond + (vm-closure? compiled) + (vm-push vm (vm-call-closure compiled args (vm-globals-ref vm))) + (= compiled :jit-failed) + (vm-push vm (cek-call-or-suspend vm f args)) + (and *jit-compile-fn* (lambda-name f)) + (do + (lambda-set-compiled! f :jit-failed) + (let + ((result (*jit-compile-fn* f (vm-globals-ref vm)))) + (if + (vm-closure? result) + (do + (lambda-set-compiled! f result) + (vm-push + vm + (vm-call-closure result args (vm-globals-ref vm)))) + (vm-push vm (cek-call-or-suspend vm f args))))) + :else (vm-push vm (cek-call-or-suspend vm f args)))))) (define vm-call (fn @@ -164,11 +188,10 @@ (cond (vm-closure? f) (vm-push-frame vm f args) - (or - (= (type-of f) "lambda") - (= (type-of f) "component") - (= (type-of f) "island")) - (vm-push vm (cek-call f args)) + (lambda? f) + (try-jit-call vm f args) + (or (= (type-of f) "component") (= (type-of f) "island")) + (vm-push vm (cek-call-or-suspend vm f args)) (callable? f) (vm-push vm (apply f args)) :else (error (str "VM: not callable: " (type-of f)))))) @@ -580,9 +603,11 @@ (fn (closure args globals) (let - ((vm (make-vm globals))) + ((prev-vm *active-vm*) (vm (make-vm globals))) + (set! *active-vm* vm) (vm-push-frame vm closure args) (vm-run vm) + (set! *active-vm* prev-vm) (vm-pop vm)))) (define vm-execute-module diff --git a/shared/static/wasm/sx/vm.sxbc b/shared/static/wasm/sx/vm.sxbc index c9c73496..a9d1d15a 100644 --- a/shared/static/wasm/sx/vm.sxbc +++ b/shared/static/wasm/sx/vm.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "676913a136fdd81d" +(sxbc 1 "c30a7128c251edd8" (code - :constants ("define-library" "sx" "vm" "export" "make-upvalue-cell" "uv-get" "uv-set!" "make-vm-code" "make-vm-closure" "make-vm-frame" "make-vm" "vm-push" "vm-pop" "vm-peek" "frame-read-u8" "frame-read-u16" "frame-read-i16" "vm-push-frame" "code-from-value" "vm-closure?" "vm-call" "frame-local-get" "frame-local-set" "frame-upvalue-get" "frame-upvalue-set" "frame-ip" "frame-set-ip!" "frame-base" "frame-closure" "closure-code" "closure-upvalues" "closure-env" "code-bytecode" "code-constants" "code-locals" "vm-sp" "vm-set-sp!" "vm-stack" "vm-set-stack!" "vm-frames" "vm-set-frames!" "vm-globals-ref" "collect-n-from-stack" "pad-n-nils" "collect-n-pairs" "vm-global-get" "vm-resolve-ho-form" "vm-call-external" "vm-global-set" "env-walk" "env-walk-set!" "vm-create-closure" "vm-run" "vm-step" "vm-call-closure" "vm-execute-module" {:upvalue-count 0 :arity 1 :constants ("uv-value") :bytecode (1 0 0 16 0 65 1 0 50)} {:upvalue-count 0 :arity 1 :constants ("get" "uv-value") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 2 :constants ("dict-set!" "uv-value") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {:upvalue-count 0 :arity 3 :constants ("make-vm-frame" "get" "sp" "for-each" {:upvalue-count 1 :arity 1 :constants ("vm-push") :bytecode (20 0 0 18 0 16 0 49 2 50)} "len" "vm-code" "vc-locals" "-" ">" 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)} "dict-set!" "frames" "cons") :bytecode (20 0 0 16 1 16 0 1 2 0 52 1 0 2 48 2 17 3 51 4 0 1 0 16 2 52 3 0 2 5 16 2 52 5 0 1 17 4 16 1 1 6 0 52 1 0 2 1 7 0 52 1 0 2 17 5 16 5 16 4 52 8 0 2 17 6 16 6 1 10 0 52 9 0 2 33 26 0 1 10 0 17 7 51 11 0 1 7 1 6 1 0 1 8 17 8 5 16 8 48 0 32 1 0 2 5 16 0 1 13 0 16 3 16 0 1 13 0 52 1 0 2 52 14 0 2 52 12 0 3 50)} {: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)} {: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)} {:upvalue-count 0 :arity 3 :constants ("vm-closure?" "vm-push-frame" "=" "type-of" "lambda" "component" "island" "vm-push" "cek-call" "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 115 0 16 1 52 3 0 1 1 4 0 52 2 0 2 6 34 32 0 5 16 1 52 3 0 1 1 5 0 52 2 0 2 6 34 14 0 5 16 1 52 3 0 1 1 6 0 52 2 0 2 33 18 0 20 7 0 16 0 16 1 16 2 52 8 0 2 49 2 32 45 0 20 9 0 16 1 48 1 33 18 0 20 7 0 16 0 16 1 16 2 52 10 0 2 49 2 32 17 0 1 13 0 16 1 52 3 0 1 52 12 0 2 52 11 0 1 50)} {: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)} {: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)} {: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)} {: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)} {:upvalue-count 0 :arity 1 :constants ("get" "ip") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 2 :constants ("dict-set!" "ip") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("get" "base") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("get" "closure") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("get" "vm-code") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("get" "vm-upvalues") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("get" "closure-env") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("get" "vc-bytecode") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("get" "vc-constants") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("get" "vc-locals") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("get" "sp") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 2 :constants ("dict-set!" "sp") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("get" "stack") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 2 :constants ("dict-set!" "stack") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("get" "frames") :bytecode (16 0 1 1 0 52 0 0 2 50)} {:upvalue-count 0 :arity 2 :constants ("dict-set!" "frames") :bytecode (16 0 1 1 0 16 1 52 0 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("get" "globals") :bytecode (16 0 1 1 0 52 0 0 2 50)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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)} {: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") :bytecode (20 2 0 18 0 48 1 52 1 0 1 52 0 0 1 33 121 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 20 0 20 14 0 18 0 16 0 16 1 16 2 16 3 48 5 5 18 1 49 0 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)} {: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 "error" "VM: IO suspension (OP_PERFORM) — request: " "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 251 6 16 5 1 6 0 52 1 0 2 33 11 0 20 4 0 16 0 2 49 2 32 228 6 16 5 1 7 0 52 1 0 2 33 11 0 20 4 0 16 0 3 49 2 32 205 6 16 5 1 8 0 52 1 0 2 33 11 0 20 4 0 16 0 4 49 2 32 182 6 16 5 1 9 0 52 1 0 2 33 10 0 20 10 0 16 0 49 1 32 160 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 131 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 89 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 47 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 7 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 223 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 171 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 119 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 75 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 9 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 203 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 148 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 68 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 10 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 210 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 141 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 97 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 53 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 2 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 204 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 156 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 108 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 60 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 12 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 220 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 172 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 124 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 91 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 58 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 25 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 248 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 200 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 152 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 116 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 83 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 50 0 16 5 1 82 0 52 1 0 2 33 25 0 20 10 0 16 0 48 1 17 6 1 84 0 16 6 52 50 0 2 52 83 0 1 32 13 0 1 85 0 16 5 52 50 0 2 52 83 0 1 50)} {:upvalue-count 0 :arity 3 :constants ("make-vm" "vm-push-frame" "vm-run" "vm-pop") :bytecode (20 0 0 16 2 48 1 17 3 20 1 0 16 3 16 0 16 1 48 3 5 20 2 0 16 3 48 1 5 20 3 0 16 3 49 1 50)} {:upvalue-count 0 :arity 2 :constants ("make-vm-closure" "list" "module" "make-vm" "make-vm-frame" 0 "pad-n-nils" "code-locals" "vm-set-frames!" "vm-run" "vm-pop") :bytecode (20 0 0 16 0 52 1 0 0 1 2 0 16 1 2 48 5 17 2 20 3 0 16 1 48 1 17 3 20 4 0 16 2 1 5 0 48 2 17 4 20 6 0 16 3 20 7 0 16 0 48 1 48 2 5 20 8 0 16 3 16 4 52 1 0 1 48 2 5 20 9 0 16 3 48 1 5 20 10 0 16 3 49 1 50)}) :bytecode (20 0 0 20 1 0 20 2 0 48 1 20 3 0 20 4 0 20 5 0 20 6 0 20 7 0 20 8 0 20 9 0 20 10 0 20 11 0 20 12 0 20 13 0 20 14 0 20 15 0 20 16 0 20 17 0 20 18 0 20 19 0 20 20 0 20 21 0 20 22 0 20 23 0 20 24 0 20 25 0 20 26 0 20 27 0 20 28 0 20 29 0 20 30 0 20 31 0 20 32 0 20 33 0 20 34 0 20 35 0 20 36 0 20 37 0 20 38 0 20 39 0 20 40 0 20 41 0 20 42 0 20 43 0 20 44 0 20 45 0 20 46 0 20 47 0 20 48 0 20 49 0 20 50 0 20 51 0 20 52 0 20 53 0 20 54 0 20 55 0 48 52 51 56 0 128 4 0 5 51 57 0 128 5 0 5 51 58 0 128 6 0 5 51 59 0 128 7 0 5 51 60 0 128 8 0 5 51 61 0 128 9 0 5 51 62 0 128 10 0 5 51 63 0 128 11 0 5 51 64 0 128 12 0 5 51 65 0 128 13 0 5 51 66 0 128 14 0 5 51 67 0 128 15 0 5 51 68 0 128 16 0 5 51 69 0 128 17 0 5 51 70 0 128 18 0 5 51 71 0 128 19 0 5 51 72 0 128 20 0 5 51 73 0 128 21 0 5 51 74 0 128 22 0 5 51 75 0 128 23 0 5 51 76 0 128 24 0 5 51 77 0 128 25 0 5 51 78 0 128 26 0 5 51 79 0 128 27 0 5 51 80 0 128 28 0 5 51 81 0 128 29 0 5 51 82 0 128 30 0 5 51 83 0 128 31 0 5 51 84 0 128 32 0 5 51 85 0 128 33 0 5 51 86 0 128 34 0 5 51 87 0 128 35 0 5 51 88 0 128 36 0 5 51 89 0 128 37 0 5 51 90 0 128 38 0 5 51 91 0 128 39 0 5 51 92 0 128 40 0 5 51 93 0 128 41 0 5 51 94 0 128 42 0 5 51 95 0 128 43 0 5 51 96 0 128 44 0 5 51 97 0 128 45 0 5 51 98 0 128 46 0 5 51 99 0 128 47 0 5 51 100 0 128 48 0 5 51 101 0 128 49 0 5 51 102 0 128 50 0 5 51 103 0 128 51 0 5 51 104 0 128 52 0 5 51 105 0 128 53 0 5 51 106 0 128 54 0 5 51 107 0 128 55 0 48 3 50))) + :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") :bytecode (20 2 0 18 0 48 1 52 1 0 1 52 0 0 1 33 121 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 20 0 20 14 0 18 0 16 0 16 1 16 2 16 3 48 5 5 18 1 49 0 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 "error" "VM: IO suspension (OP_PERFORM) — request: " "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 251 6 16 5 1 6 0 52 1 0 2 33 11 0 20 4 0 16 0 2 49 2 32 228 6 16 5 1 7 0 52 1 0 2 33 11 0 20 4 0 16 0 3 49 2 32 205 6 16 5 1 8 0 52 1 0 2 33 11 0 20 4 0 16 0 4 49 2 32 182 6 16 5 1 9 0 52 1 0 2 33 10 0 20 10 0 16 0 49 1 32 160 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 131 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 89 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 47 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 7 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 223 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 171 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 119 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 75 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 9 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 203 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 148 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 68 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 10 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 210 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 141 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 97 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 53 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 2 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 204 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 156 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 108 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 60 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 12 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 220 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 172 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 124 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 91 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 58 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 25 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 248 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 200 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 152 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 116 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 83 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 50 0 16 5 1 82 0 52 1 0 2 33 25 0 20 10 0 16 0 48 1 17 6 1 84 0 16 6 52 50 0 2 52 83 0 1 32 13 0 1 85 0 16 5 52 50 0 2 52 83 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 ("make-vm-closure" "list" "module" "make-vm" "make-vm-frame" 0 "pad-n-nils" "code-locals" "vm-set-frames!" "vm-run" "vm-pop") :bytecode (20 0 0 16 0 52 1 0 0 1 2 0 16 1 2 48 5 17 2 20 3 0 16 1 48 1 17 3 20 4 0 16 2 1 5 0 48 2 17 4 20 6 0 16 3 20 7 0 16 0 48 1 48 2 5 20 8 0 16 3 16 4 52 1 0 1 48 2 5 20 9 0 16 3 48 1 5 20 10 0 16 3 49 1 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 1 117 0 112 5 2 50)))