feat(jit/aot): native OP_PARMAP Cranelift path (ILO-353)#692
Merged
danieljohnmorris merged 1 commit intoMay 22, 2026
Conversation
Add `jit_parmap` extern "C" helper and wire OP_PARMAP into both the JIT (jit_cranelift.rs) and AOT (compile_cranelift.rs) Cranelift backends so par-map no longer falls through to the VM interpreter. - `jit_parmap(fn_bits, xs_bits, concurrency_or_sentinel) -> result_bits` mirrors the VM's OP_PARMAP dispatch arm: resolves FnRef / closure / text callees, fans out over scoped worker threads, returns L(R _ t). - Both HelperFuncs structs gain a `parmap: FuncId` field declared as `jit_parmap` with signature (i64, i64, i64) -> i64. - JIT register helpers table registers the symbol. - OP_PARMAP arms added to both codegen dispatch loops; data word consumed at compile time via `skip_next = true` matching OP_POSTH pattern. - OP_PARMAP added to `find_block_leaders` 2-word skip list so its data word bytes are never mis-decoded as opcode leaders. - OP_PARMAP added to non_num_write classification lists and the two prepass/fixpoint data-word-skip guards in both codegen files. - All 8 existing op_parmap_* unit tests pass; zero regressions. Extends ILO-352 (#688) / ILO-67 (#610). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jit_parmapextern "C" helper that mirrors the VM'sOP_PARMAPdispatch arm: resolves FnRef/closure/text callees, fans out overstd::thread::scopeworkers, returnsL(R _ t)in input orderOP_PARMAPinto both Cranelift backends (JIT:jit_cranelift.rs, AOT:compile_cranelift.rs) — par-map no longer falls through to the interpreter on these pathsskip_next = true(same pattern asOP_POSTH);find_block_leadersupdated to skip it as a 2-word instruction; prepass/fixpoint classification loops guarded accordinglyTest plan
op_parmap_*unit tests pass (cargo test --features cranelift op_parmap)--features craneliftcargo build --features craneliftExtends ILO-352 (#688) / ILO-67 (#610).
🤖 Generated with Claude Code