XCX 4.1 — The Runtime Refinement Update


XCX 4.1 is a refinement update building on the JIT foundation introduced in 4.0. The main change is JIT-to-JIT direct dispatch, allowing compiled functions to call each other without returning to the interpreter, reducing cross-function call overhead by ~47%. The release also introduces eager callee pre-compilation, inlined collection size access, configurable hotspot thresholds, REPL improvements, SQLite FFI parity fixes, and a PAX self-upgrade system.


~47% cross-function call reduction

12.87ms Fib(30) with JIT

25ms 1M cross-function calls


What’s new

JIT-to-JIT Direct Call Dispatch

Compiled functions now call other compiled functions directly via Cranelift call_indirect. The interpreter is no longer re-entered for compiled-to-compiled calls. A fast path checks callee jit_ptr atomically; missing entries fall back to the existing slow path. Execution state is fully managed in JIT-emitted code.


Eager Callee Pre-Compilation

Before IR generation, the compiler scans bytecode for function calls and pre-compiles detected callees. This makes direct dispatch available immediately on first execution. Cycle detection prevents recursive compilation loops.


Inlined Collection Sizes

.size(), .len(), and .count()

for Array, BoolArray, and Map are now handled directly in JIT code. Size reads compile to a direct 64-bit memory load, removing FFI overhead.


Pointer Analysis Optimization

analyze_maybe_ptr_regs now uses a 256-bit bitmask implemented as four 64-bit integers. This reduces merge overhead from per-bit iteration to simple bitwise operations.


Configurable Hotspot Threshold

Hotspot compilation threshold is now runtime configurable via --threshold. Default remains 50 executions before compilation. Invalid values terminate execution with error code 1.


Standard Library Updates

Array.slice(start, end)

supports half-open ranges [start, end) with clamping. json.keys() returns all top-level keys as string arrays.


REPL Improvements

New keybindings for line navigation and command execution. Immediate execution for !-prefixed commands. New diagnostics: !globals, !jit, !reset. Fixed state carryover issues between sessions.


SQLite FFI Parity

JIT and interpreter now handle SQLite soft errors consistently. Errors no longer incorrectly increment error counters under JIT execution.


PAX Self-Upgrade

PAX can now update compiler and tooling. Supports version checks, binary replacement, and safe Windows file swapping via .old fallback.


Multiple Variable Declarations

Support added for grouped variable declarations in both typed and var forms. Implemented via compile-time desugaring with no runtime overhead.


Technical Debt Reduction

Removed unused parameters, merged dispatch paths, eliminated redundant analysis passes, and optimized allocation patterns in the register system. Build now completes without warnings.


Bug Fixes

Block comments now require explicit closing tokens. Added extended error test coverage for runtime and compile-time error handling.


Performance results

Loop 100M: 116.27ms (−2.3%)
Fib(30): 12.87ms (−8.1%)
Sieve 100K: 2.29ms (−8.4%)
JSON 1000×100: 21.46ms (−6.7%)
Cross-function 1M calls: 25ms (−46.8%)


Test system: AMD Ryzen 7 5800X, 32 GB RAM, Windows 11