Repository navigation
Conversation
vchuravy
force-pushed
the
vc/jc-18-emit-into
branch
from
October 19, 2026 16:20
e662430 to
0f02374
Compare
vchuravy
force-pushed
the
vc/jc-19-jit
branch
2 times, most recently
from
October 19, 2026 16:35
5469e32 to
8692f56
Compare
vchuravy
force-pushed
the
vc/jc-19-jit
branch
from
October 19, 2026 17:08
8692f56 to
903a59d
Compare
`JIT(; config, pipeline, relocatable)`, `jit_compile(jit, tt) -> JITFunction` and `jit_call(jit, f, args...)` compile calls with JuliaCodegen into Julia's JIT through LLVM.jl's `JuliaOJIT`, without unmerged Julia APIs: - IR: `JITInterpreter`, native inference whose CodeInstances have an owner of their own and keep their uncompressed sources. `collect_codeinfos` gathers the closed set a call needs, re-inferring the code of functions with a constant result, and `emit_into!` compiles it. - Cache: keyed by the CodeInstance, looked up in the interpreter's cache first, so redefining a method recompiles what depends on it. - Linking: each set gets a module of its own; only the root's entries are external, under names unique in the process. The literal objects are bound to their addresses and kept alive. `jl_get_pgcstack_resolved` is bound (moved here from the test JIT). The pipeline runs. - One lock per JIT. `JITFunction` has the jlcall entry (`fptr`, which calling it uses), the specsig entry (`specptr`; a C function with `gcstack_arg=false`) and the fallbacks. Also: the memory test's allocation count is the least of three measurements; it was flaky in the full nightly suite. Assisted-by: Claude Code (Opus 5.5)
Assisted-by: Claude Code (Opus 5.5)
vchuravy
force-pushed
the
vc/jc-19-jit
branch
from
October 19, 2026 17:35
903a59d to
821fbc5
Compare
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.
Stacked on #19. This completes plan P4's drivers. The runtime hook remains, on its own stack.
It uses no unmerged Julia API; everything goes through LLVM.jl's
JuliaOJIT.JITInterpreteris native inference with a cache owner of its own (:JuliaCodegen). Its CodeInstances keep uncompressed sources (may_discard_trees/may_compressare false).collect_codeinfos(interp, mi)gathers the closed set that the call:invokes. Functions with a constant result have no kept source, so they are re-inferred withtypeinf_code. Varargs callees are left to the runtime.emit_into!(emit_into!: compile a closed set of CodeInstances into the caller's module #19) compiles the set.jlcodegen_N, shared by allJITs because they share Julia's JIT);JIT;jl_get_pgcstack_resolvedis bound to the runtime's getter (moved from the test JIT into the driver);JIT.Not included: publishing compiled code into CodeInstances (
ci.invoke/specptr), so that native callers use it. That belongs to the hook stack.Tests (
test/jitdriver.jl)jit_call;stdcallcallee is recorded with:fallbackand throws with:error;gcstack_arg=false);The JIT tests also pass under
JULIACODEGEN_GC_STRESS=1and with-t 4.Also: the memory test's allocation count is now the least of three measurements. It failed once in a full nightly run and passed on reruns.
Tested locally with
julia +1.12,+1.13and+nightly: 6955, 6961 and 6960 tests pass.🤖 Generated with Claude Code