Recompile all 26 .sxbc with define-library wrappers + fix eval/JIT
All 26 browser modules recompiled with define-library/import forms. Compilation works without vm-compile-adapter (JIT pre-compilation hangs with library wrappers in some JIT paths — skipped for now, CEK compilation is ~34s total). Key fixes: - eval command: import-aware loop that handles define-library/import locally without touching the Python bridge pipe (avoids deadlock) - compile-modules.js: skip vm-compile-adapter, bump timeout 2621/2621 OCaml tests passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,94 @@
|
||||
;; --------------------------------------------------------------------------
|
||||
|
||||
;; Stack / Constants
|
||||
|
||||
(define-library (sx bytecode)
|
||||
(export
|
||||
OP_CONST
|
||||
OP_NIL
|
||||
OP_TRUE
|
||||
OP_FALSE
|
||||
OP_POP
|
||||
OP_DUP
|
||||
OP_LOCAL_GET
|
||||
OP_LOCAL_SET
|
||||
OP_UPVALUE_GET
|
||||
OP_UPVALUE_SET
|
||||
OP_GLOBAL_GET
|
||||
OP_GLOBAL_SET
|
||||
OP_JUMP
|
||||
OP_JUMP_IF_FALSE
|
||||
OP_JUMP_IF_TRUE
|
||||
OP_CALL
|
||||
OP_TAIL_CALL
|
||||
OP_RETURN
|
||||
OP_CLOSURE
|
||||
OP_CALL_PRIM
|
||||
OP_APPLY
|
||||
OP_LIST
|
||||
OP_DICT
|
||||
OP_APPEND_BANG
|
||||
OP_ITER_INIT
|
||||
OP_ITER_NEXT
|
||||
OP_MAP_OPEN
|
||||
OP_MAP_APPEND
|
||||
OP_MAP_CLOSE
|
||||
OP_FILTER_TEST
|
||||
OP_HO_MAP
|
||||
OP_HO_FILTER
|
||||
OP_HO_REDUCE
|
||||
OP_HO_FOR_EACH
|
||||
OP_HO_SOME
|
||||
OP_HO_EVERY
|
||||
OP_SCOPE_PUSH
|
||||
OP_SCOPE_POP
|
||||
OP_PROVIDE_PUSH
|
||||
OP_PROVIDE_POP
|
||||
OP_CONTEXT
|
||||
OP_EMIT
|
||||
OP_EMITTED
|
||||
OP_RESET
|
||||
OP_SHIFT
|
||||
OP_DEFINE
|
||||
OP_DEFCOMP
|
||||
OP_DEFISLAND
|
||||
OP_DEFMACRO
|
||||
OP_EXPAND_MACRO
|
||||
OP_STR_CONCAT
|
||||
OP_STR_JOIN
|
||||
OP_SERIALIZE
|
||||
OP_ADD
|
||||
OP_SUB
|
||||
OP_MUL
|
||||
OP_DIV
|
||||
OP_EQ
|
||||
OP_LT
|
||||
OP_GT
|
||||
OP_NOT
|
||||
OP_LEN
|
||||
OP_FIRST
|
||||
OP_REST
|
||||
OP_NTH
|
||||
OP_CONS
|
||||
OP_NEG
|
||||
OP_INC
|
||||
OP_DEC
|
||||
OP_ASER_TAG
|
||||
OP_ASER_FRAG
|
||||
BYTECODE_MAGIC
|
||||
BYTECODE_VERSION
|
||||
CONST_NUMBER
|
||||
CONST_STRING
|
||||
CONST_BOOL
|
||||
CONST_NIL
|
||||
CONST_SYMBOL
|
||||
CONST_KEYWORD
|
||||
CONST_LIST
|
||||
CONST_DICT
|
||||
CONST_CODE
|
||||
opcode-name)
|
||||
(begin
|
||||
|
||||
(define OP_CONST 1) ;; u16 pool_idx — push constant
|
||||
(define OP_NIL 2) ;; push nil
|
||||
(define OP_TRUE 3) ;; push true
|
||||
@@ -161,3 +249,9 @@
|
||||
(= op 50) "RETURN" (= op 52) "CALL_PRIM"
|
||||
(= op 128) "DEFINE" (= op 144) "STR_CONCAT"
|
||||
:else (str "OP_" op))))
|
||||
|
||||
|
||||
)) ;; end define-library
|
||||
|
||||
;; Re-export to global namespace for backward compatibility
|
||||
(import (sx bytecode))
|
||||
|
||||
Reference in New Issue
Block a user