Skip to content

WIP: ob read API AOT prep — array_pop fix + lazy stack link (#4914)#17116

Open
PurHur wants to merge 1 commit into
masterfrom
agent/issue-4914-ob-read-api-aot
Open

WIP: ob read API AOT prep — array_pop fix + lazy stack link (#4914)#17116
PurHur wants to merge 1 commit into
masterfrom
agent/issue-4914-ob-read-api-aot

Conversation

@PurHur

@PurHur PurHur commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Partial progress toward #4914 (JIT/AOT lowering for ob_get_contents / ob_get_length / ob_end_clean).

Blocker (AOT user-script)

JIT is already green. AOT bin/compile.php (sets PHP_COMPILER_AOT_USER_SCRIPT=1) still fails:

  • Link: read/discard __phpc_ob_* symbols undefined — ObOutputUserScriptLlvm only emits echo bridges.
  • Full stack nested JIT: ObOutputJitBridge::implementObStack module-verify fails on STDOUT stream filter during inline helper compile.

Investigation notes on the issue: #4914 (comment)

Verification

# JIT (green)
HARNESS_DOCKER_RUN_OPTS='--memory=8g --cpus=2' ./script/docker-exec.sh -- bash -lc \
  'source script/php-env.sh && php bin/jit.php -r "ob_start(); echo \"hello\"; \$c=ob_get_contents(); \$l=ob_get_length(); ob_end_clean(); echo \$c,\$l,ob_get_level(),\"\\n\";"'
# hello50

# AOT (still red — link)
HARNESS_DOCKER_RUN_OPTS='--memory=8g --cpus=2' ./script/docker-exec.sh -- bash -lc \
  'source script/php-env.sh && vendor/bin/phpunit --filter ob_get_contents'

Refs #4914not ready to merge until AOT fixture test/fixtures/aot/cases/ob_get_contents.phpt passes.

Made with Cursor

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant