WIP: ob read API AOT prep — array_pop fix + lazy stack link (#4914)#17116
Open
PurHur wants to merge 1 commit into
Open
WIP: ob read API AOT prep — array_pop fix + lazy stack link (#4914)#17116PurHur wants to merge 1 commit into
PurHur wants to merge 1 commit into
Conversation
Replace array_pop() in ObOutputJitHelper with manual popStackTop() so nested JIT can compile the full PHP ob stack without HashTable::popLast() misroute. Wire ob_get_contents/ob_get_length/ob_end_clean/ob_get_level JIT lowering to ObOutputRuntime::ensureObStackLinked() like ob_get_clean already does. AOT user-script read APIs still need exec-capture LLVM bridges or a prelinked ObOutputJitHelper unit — see issue #4914 comment. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 7, 2026
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
Partial progress toward #4914 (JIT/AOT lowering for
ob_get_contents/ob_get_length/ob_end_clean).ObOutputJitHelperno longer usesarray_pop()— manualpopStackTop()avoids nested-JIT misroute toHashTable::popLast()(Stdlib: system()/passthru() bypass active output buffer — ob_get_clean() empty (ext/standard/exec.c) #10492), unblocking fullObOutputJitBridgestack compilation later.JitObGetContents/JitObGetLength/JitObEndClean/JitObGetLevelnow callObOutputRuntime::ensureObStackLinked()before ABI emission (parity withJitObGetClean).Blocker (AOT user-script)
JIT is already green. AOT
bin/compile.php(setsPHP_COMPILER_AOT_USER_SCRIPT=1) still fails:__phpc_ob_*symbols undefined —ObOutputUserScriptLlvmonly emits echo bridges.ObOutputJitBridge::implementObStackmodule-verify fails onSTDOUTstream filter during inline helper compile.Investigation notes on the issue: #4914 (comment)
Verification
Refs #4914 — not ready to merge until AOT fixture
test/fixtures/aot/cases/ob_get_contents.phptpasses.Made with Cursor