Defer nested-JIT standalone init for bootstrap AOT compile (#14472)#14480
Merged
PurHur merged 2 commits intoJul 1, 2026
Merged
Conversation
#14472). Standalone spine init now stubs heavy JsonEncode/Getenv/CliArgv helpers instead of running nested php-in-PHP JIT during loadJitContext, which LLVM 9 was segfaulting on. Adds regression tests for echo_hello compile and loadJitContext completion. Co-authored-by: Cursor <cursoragent@cursor.com>
…l/JsonEncode conflicts). Co-authored-by: Cursor <cursoragent@cursor.com>
50 tasks
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
StreamIoRuntime::beginStandaloneInitPhase()soensureFullStandaloneBodies()defers nested php-in-PHP JIT (JsonEncode, Getenv, CliArgv, stream/json stubs) during standalone spine init — fixes exit 139 inloadJitContext()/StringJsonEncode::ensureJitHelperCompiled.ensureUserScriptMainStubsduring defer; skipStringGetenvAllnested JIT; lazy-link soundex/metaphone/parse_str during defer.ObOutputRuntime,ValueEchoRuntime,StringRandomBytesin full standalone bodies; skip VM env-probe gate forbootstrap-aot/entries.StringJsonEncode::implement:NestedJitCompileScopeguard + insert-block restore for future fullensureLinkedlowering.Root cause (#14472)
Nested
jit->compile(JsonEncodeJitHelper)duringensureFullStandaloneBodiessegfaulted LLVM 9 after #14470 unblocked CliArgv. Same class as #13245 inventory defer — spine init only needs linkable ABI stubs until user code callsensureLinked.Verification
Handoff
echo_hellobinary still segfaults atc:main_before_phpwhen run — compile/link gate is green; follow-up needed for AOT main() runtime path.ensureLinkedstill needs stub→full upgrade when user code callsjson_encode(e.g.test/bootstrap-aot/stdlib_json.php).Closes #14472
Made with Cursor