Revert VM HOF primitives — broke OCaml JIT CALL_PRIM dispatch

Registering map/for-each/reduce as PRIMITIVES caused the compiler to
emit CALL_PRIM for them everywhere. The OCaml VM's call-primitive
can't invoke VM closures, causing "Undefined symbol: resource" crashes.

Revert vm.sx to original CALL_PRIM handler. Remove map/for-each/reduce
from JS PRIMITIVES so compiler emits OP_CALL instead (handled by
vm-call which dispatches correctly).

3 JS VM tests remain failing (VM closure interop) but production is stable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 10:18:07 +00:00
parent 1b13872369
commit d9aa19cfe9
3 changed files with 555 additions and 537 deletions

1032
lib/vm.sx

File diff suppressed because it is too large Load Diff