Category
php-in-php · php-src-strict
Problem
http_response_code() JIT/AOT lowering uses lib/JIT/Builtin/HttpResponseCode.php (~375 lines) with LLVM module globals (__phpc_http_response_status, __phpc_http_response_code_apply) and hand-rolled boxing. VM semantics already live in ext/standard/VmHttpResponse.php / http_response_code.php (PHP).
Duplicate LLVM state diverges from VM fixes (#9306 return-int regression, 0 no-op setter) and blocks shrinking the native bridge.
php-src reference
Repro (JIT divergence)
<?php
http_response_code(404);
var_dump(http_response_code());
var_dump(is_int(http_response_code()));
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php repro.php
php bin/vm.php repro.php
php bin/jit.php repro.php
'
| Mode |
Expected |
| VM |
int(404), is_int true |
| JIT |
same as VM after migration |
Scope (this repo)
| Layer |
Work |
| JIT |
Replace HttpResponseCode::implement() LLVM globals with call into VmHttpResponse / shared PHP helper |
| Delete/shrink |
lib/JIT/Builtin/HttpResponseCode.php LLVM bodies; keep thin trampoline if needed |
| AOT |
same entry as JIT |
| Tests |
extend test/compliance/cases/stdlib/http_response_code*.phpt for JIT |
PHP-in-PHP: route through existing ext/standard PHP; delete LLVM global/status apply table.
Done when
Related
Category
php-in-php· php-src-strictProblem
http_response_code()JIT/AOT lowering useslib/JIT/Builtin/HttpResponseCode.php(~375 lines) with LLVM module globals (__phpc_http_response_status,__phpc_http_response_code_apply) and hand-rolled boxing. VM semantics already live inext/standard/VmHttpResponse.php/http_response_code.php(PHP).Duplicate LLVM state diverges from VM fixes (#9306 return-int regression,
0no-op setter) and blocks shrinking the native bridge.php-src reference
ext/standard/head.c—php_http_response_codeext/standard/VmHttpResponse.phpRepro (JIT divergence)
int(404),is_inttrueScope (this repo)
HttpResponseCode::implement()LLVM globals with call intoVmHttpResponse/ shared PHP helperlib/JIT/Builtin/HttpResponseCode.phpLLVM bodies; keep thin trampoline if neededtest/compliance/cases/stdlib/http_response_code*.phptfor JITPHP-in-PHP: route through existing
ext/standardPHP; delete LLVM global/status apply table.Done when
http_response_code(0)no-opHttpResponseCode.phpLLVM lowered by >50% (lines or symbols deleted — note in PR)./script/ci-fast.sh --filter http_response_codegreenRelated