Skip to content

php-in-php: route http_response_code JIT through HttpResponseJitHelper (#9344) - #10854

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-http-response-9344
Jun 23, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-http-response-9344

Conversation

@PurHur

@PurHur PurHur commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ext/standard/HttpResponseJitHelper.php as PHP SSOT for JIT/AOT HTTP status storage (mirrors ResponseContext semantics).
  • Replace lib/JIT/Builtin/HttpResponseCode.php LLVM globals (__phpc_http_response_status*, ~355 lines of hand-rolled apply/boxing) with thin facade delegating to HttpResponseRuntime bridges into compiled PHP.
  • Update PendingHeadersRuntime to read/write status via HttpResponseRuntime instead of LLVM globals.

LLVM shrink: HttpResponseCode.php 392 → 37 lines; deleted addGlobal(__phpc_http_response_status*) and inline apply CFG.

Closes #9344

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php vendor/bin/phpunit test/unit/HttpResponseCodeRuntimeShrinkTest.php
php vendor/bin/phpunit --filter http_response_code_jit test/compliance/
php bin/jit.php test/repro/http_response_code_return_int.php
make bootstrap-selfhost-vm-driver-execute-probe
php script/check-selfhost-spine-coverage-sync.php
'

Output (2026-06-23):

OK (4 tests, 14 assertions)                          # HttpResponseCodeRuntimeShrinkTest
OK (3 tests, 3 assertions)                           # http_response_code_jit compliance
bool(true)\nint(404)\n... (×4)                       # JIT repro matches VM
bootstrap-selfhost-vm-driver-execute-probe: OK
check-selfhost-spine-coverage-sync: OK

php-src reference

  • ext/standard/head.c — php_http_response_code
  • VM port: ext/standard/VmHttpResponse.php → ResponseContext

Made with Cursor

#9344)

Replace LLVM module globals __phpc_http_response_status* with compiled PHP
static storage; HttpResponseCode.php shrinks to a thin facade over
HttpResponseRuntime bridges. PendingHeaders reads status via the same path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit c4206bb into master Jun 23, 2026
@PurHur
PurHur deleted the agent/runtime-php-http-response-9344 branch June 23, 2026 15:20
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 HttpResponseCode — route http_response_code() through VmHttpResponse PHP not LLVM globals (#1492)

1 participant