jit: the JIT runtime entry points get their own file; three AOT emitter fixes - #3999
Merged
Conversation
aleksisch
force-pushed
the
aleksisch/jit-runtime-split
branch
from
September 11, 2026 12:34
45821e1 to
f17ce67
Compare
src/builtin/jit_runtime.cpp is not a module - it is the set of extern "C" symbols jitted and LLVM-AOT-emitted code links against, plus the address takers the jit module binds. module_jit.cpp keeps the das module: bindings, linker invocation and emit orchestration.
aleksisch
force-pushed
the
aleksisch/jit-runtime-split
branch
3 times, most recently
from
September 11, 2026 12:53
779e500 to
c90c578
Compare
… field's module A member-pointer expression spelled its structure with the module's own name rather than aotModuleName, so a namespaced module - every standalone context - emitted `&Node::next` against an undeclared Node. A raw `?` in an emitted literal read as a trigraph. dumpAnnotationInfo clears its name table before writing rather than after. A used structure keeps its field types' modules alive: a handled field is the only thing reaching the module that declares it, and dropping that module dropped its aot_require include. A standalone context emits its own module's structures whether or not code reaches them, so an unreferenced one is walked too.
aleksisch
force-pushed
the
aleksisch/jit-runtime-split
branch
from
September 11, 2026 13:28
c90c578 to
458ba4c
Compare
`daslang -aot script.das out.cpp -aot-macros` core dumped whenever the module graph
carried a dasbind [extern], which covers every dasLLVM binding:
Should be unreachable. We handled it in transformCall. Failed on: c_strlen.
-aot-macros sets export_all, which force-marks every function of every module and skips
removeUnusedSymbols, so an [extern] declaration - which has no body - reached simulate.
Simulating has to succeed there, so the annotation answers a node that throws if anything
actually calls it: transformCall rewrites every CALL site, so only an address-taken extern
reaches the body, and an empty one would answer uninitialized stack.
That placeholder is no more compilable than it is runnable, so the extern asks for no JIT
the way it already asks for no AOT - taking its address otherwise walks the JIT emitter
into a declaration it cannot type.
aleksisch
force-pushed
the
aleksisch/jit-runtime-split
branch
from
September 11, 2026 14:32
458ba4c to
f79bacf
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.
Two commits lifted out of #3927 so that PR carries only its own feature.
jit: the runtime entry points JIT code calls move to their own filesrc/builtin/module_jit.cppheld two unrelated things: the das module (bindings, linker invocation, emit orchestration) and the set ofextern "C"symbols jitted and LLVM-AOT-emitted code links against. The second set moves tosrc/builtin/jit_runtime.cpp, which registers no module - 2020 lines become 759 + 1265.A pure move: sorting both files' lines and diffing against the original shows no line removed and no line changed, only the new file's include block, its
namespace das {wrapper and the fio forward declarations it repeats.src/builtin/jit_runtime.hcarries the 48 address takers the module binds, so they leaveinclude/daScript/simulate/aot_builtin_jit.h- the headerModule_Jit::aotRequireinjects into generated AOT C++. They are codegen-time queries that AOT output never calls:modules/dasLLVM/daslib/*.dasis outside the AOT glob, and the one generated.cppthat carries the include uses nothing from it. What stays in the public header is the instrumentation API a das program can legitimately call and have AOT-compiled.The new header opens with the rule that keeps it short: an entry point here is a call boundary the optimizer cannot see through, so an operation that can be expressed as LLVM IR should be, and a runtime entry point is for what cannot.
aot: the C++ emitter qualifies a name, types a lane, and keeps a field's moduleThree independent AOT emitter defects:
v_extract_*ifed a signed/unsigned comparison and tripped-Wsign-compare;The name table is also cleared before each emission, which a second emission in one process needs.