Skip to content

php-in-php: route ob_get_status JIT through ObStatusJitHelper PHP (#9497) - #10477

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-ob-status
Jun 21, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-ob-status

Conversation

@PurHur

@PurHur PurHur commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ext/standard/ObStatusJitHelper.php as SSOT for ob status numeric fields (type, flags, level, buffer_used, …).
  • Rewrite lib/JIT/Builtin/ObStatusRuntime.php to compile the helper and call buildStatusEntryPartial() from thin LLVM bridges; handler name string stays a one-line LLVM __hashtable__setStringKeyString attach (JIT helper compile cannot use Variable::string() today — same constraint as GcStatusJitHelper).
  • VmOb delegates status row assembly to the shared helper for VM/JIT parity.
  • Removed LLVM __phpc_ob_status_entry and __hashtable__setStringKeyLong numeric field emission (~60 lines of duplicated hashtable builder).

php-src reference

  • ext/standard/output.c — PHP_FUNCTION(ob_get_status), ob_list_handlers

LLVM shrink

File Before After
lib/JIT/Builtin/ObStatusRuntime.php 396 lines 453 lines (bridge + helper compile glue; numeric row body moved to PHP)
Deleted symbols __phpc_ob_status_entry, implementStatusEntry LLVM numeric setStringKeyLong chain

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter ObStatusRuntimeShrink'
# OK (3 tests, 8 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/compliance/cases/stdlib/ob_get_status.phpt
php bin/jit.php test/compliance/cases/stdlib/ob_get_status.phpt'
# VM + JIT output identical:
# 0:default output handler:1
# 1:0:1
# 1:5
# 2:0:1:5
# 1

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

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

Closes #9497

Made with Cursor

)

Move ob status numeric field assembly from LLVM into ObStatusJitHelper;
ObStatusRuntime bridge reads ob globals and attaches handler name. VmOb
delegates to the shared helper for VM parity.

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 ObStatusRuntime — route ob_get_status/ob_list_handlers through VmOutput PHP not LLVM globals (#1492)

1 participant