Skip to content

php-in-php: route JIT ob_* stack through ObOutputJitHelper not LLVM monolith (#9268) - #11706

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-9268-ob-output-php
Jun 25, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-9268-ob-output-php

Conversation

@PurHur

@PurHur PurHur commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ext/standard/ObOutputJitHelper.php as PHP SSOT for JIT/embed output-buffer stack (mirrors lib/VM/OutputBuffer.php semantics).
  • Replace the ~1,087-line ObOutputRuntime.php LLVM monolith with a 28-line delegator + ObOutputJitBridge.php thin trampolines (NestedJitCompileScope → compiled PHP helpers).
  • Quarantine standalone AOT LLVM in ObOutputStandaloneLlvm.php (same pattern as ZlibRuntime / StringZlibJit).

LLVM shrink (JIT/embed path): ObOutputRuntime.php 1087 → 28 lines; stack logic moved to PHP (ObOutputJitHelper 263 lines) + bridge (620 lines). No ObStorageGlobals in JIT bridge.

php-src ref: ext/standard/output.c

Verification

# Issue repro — VM + JIT match Zend
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "
ob_start(); echo \"hello\"; \$buf = ob_get_contents(); ob_end_clean();
var_dump(\$buf); echo ob_get_level(), \"\\n\";
"
php bin/jit.php -r "
ob_start(); echo \"hello\"; \$buf = ob_get_contents(); ob_end_clean();
var_dump(\$buf); echo ob_get_level(), \"\\n\";
"'
# string(5) "hello" / 0 on both

vendor/bin/phpunit test/unit/ObOutputRuntimeShrinkTest.php
# OK (3 tests, 20 assertions)

vendor/bin/phpunit test/unit/JIT/ObOutputRuntimeStandaloneTest.php
# OK (1 test, 17 assertions)

php script/check-selfhost-spine-coverage-sync.php
# OK

make bootstrap-selfhost-vm-driver-execute-probe
# OK

Closes #9268

Made with Cursor

…onolith (#9268)

Move output-buffer semantics to ext/standard/ObOutputJitHelper.php for JIT/embed;
thin ObOutputJitBridge LLVM trampolines replace the ~1k-line ObOutputRuntime body.
Standalone AOT keeps LLVM in ObOutputStandaloneLlvm (ZlibRuntime quarantine pattern).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 93f91e0 into master Jun 25, 2026
@PurHur
PurHur deleted the agent/issue-9268-ob-output-php branch June 25, 2026 16:35
PurHur added a commit that referenced this pull request Jun 25, 2026
…11706). (#11709)

Regenerate inventory for new ObOutput/Object LLVM helper files and add
five missing require_once entries to compiler_lib_spine_smoke so spine
coverage sync stays green after #9268.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
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.

php-in-php: JIT ObOutputRuntime — route ob_* stack through VmObOutput PHP not ~1k-line LLVM (#1492)

1 participant