JIT: skip recompilation for known-failed closure names

New closure instances of functions like parse-loop get l_compiled=None
even though a previous instance already failed. Now check _jit_warned
by name and immediately sentinel-mark new instances of known failures.

The first failure is always logged. Subsequent instances are silently
sentinel-marked — no recompilation, no log spam, no suppressed errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 19:54:13 +00:00
parent 7ea4c3a652
commit 62d8602de4

View File

@@ -728,6 +728,8 @@ let register_jit_hook env =
| Some _ -> None (* compile failed or disabled — CEK handles *)
| None ->
if !_jit_compiling then None
else if Hashtbl.mem _jit_warned fn_name then
(l.l_compiled <- Some Sx_vm.jit_failed_sentinel; None)
else begin
_jit_compiling := true;
let t0 = Unix.gettimeofday () in