Browser JIT: compile SX lambdas to bytecode VM in WASM kernel

- Wire up jit_call_hook in sx_browser.ml (same pattern as server)
- Deferred JIT: _jit_enabled flag, enabled after boot-init completes
  (prevents "Undefined symbol" errors from compiling during .sx loading)
- enable-jit! native function called by sx-platform.js after boot
- sx-platform.js: async WASM kernel polling + JIT enable after init
- Error logging for JIT compile failures and runtime fallbacks

Performance: 858ms → 431ms (WASM CEK) → 101ms (WASM JIT)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 17:04:39 +00:00
parent c72a5af04d
commit 226c01bbf6
12 changed files with 76 additions and 5 deletions

View File

@@ -339,6 +339,7 @@
var _doInit = function() {
loadWebStack();
Sx.init();
K.eval('(enable-jit!)');
};
if (document.readyState === "loading") {