Category
php-in-php · runtime-shrink (#1492, peer #31458 / #31498 / #31403)
Problem
User-script strchr()/strstr() already route through PHP (VmString::strstr / StrstrJitHelper) — PHP strchr is an alias of strstr, not libc. Always-on LibcExtern still registers libc strchr and dead libc strstr for every compile.
| Path |
Today |
Target |
User-script AOT strchr()/strstr() |
VmString::strstr / helpers (already) |
unchanged |
LibcExtern |
always-on strchr + strstr |
drop both rows |
NestedJIT putenv leaf (StringGetenv) |
lookupFunction('strchr') via always-on |
ensureLibcStrchr module-local |
NestedJIT JitParseStrUserScriptCstrKernel |
already declares strchr in ensureLibc |
unchanged |
libc strstr |
no lookupFunction consumers |
delete dead always-on |
php-src reference
PHP implementation target
lib/JIT/LibcExtern.php — drop strchr + strstr rows; cite this issue
lib/JIT/Builtin/StringGetenv.php — ensureLibcStrchr before NestedJIT putenv strchr lookup
ext/standard/JitParseStrUserScriptCstrKernel.php — keep existing module-local strchr in ensureLibc
test/unit/LibcExternDeadDeclsRuntimeShrinkTest.php — guard the drop
Repro
./script/phpunit.sh --filter LibcExternDeadDeclsRuntimeShrinkTest
./script/phpunit.sh --filter 'StringGetenv|ParseStr|Strstr'
Done when
Refs #1492, #31458, #31498, #31403
Category
php-in-php· runtime-shrink (#1492, peer #31458 / #31498 / #31403)Problem
User-script
strchr()/strstr()already route through PHP (VmString::strstr/StrstrJitHelper) — PHPstrchris an alias ofstrstr, not libc. Always-onLibcExternstill registers libcstrchrand dead libcstrstrfor every compile.strchr()/strstr()VmString::strstr/ helpers (already)LibcExternstrchr+strstrStringGetenv)lookupFunction('strchr')via always-onensureLibcStrchrmodule-localJitParseStrUserScriptCstrKernelstrchrinensureLibcstrstrlookupFunctionconsumersphp-src reference
PHP_FUNCTION(strstr)/strchralias (semantics stay in PHP; libc strchr is NestedJIT putenv/parse_strthin ABI only)PHP implementation target
lib/JIT/LibcExtern.php— dropstrchr+strstrrows; cite this issuelib/JIT/Builtin/StringGetenv.php—ensureLibcStrchrbefore NestedJIT putenvstrchrlookupext/standard/JitParseStrUserScriptCstrKernel.php— keep existing module-localstrchrinensureLibctest/unit/LibcExternDeadDeclsRuntimeShrinkTest.php— guard the dropRepro
./script/phpunit.sh --filter LibcExternDeadDeclsRuntimeShrinkTest ./script/phpunit.sh --filter 'StringGetenv|ParseStr|Strstr'Done when
strchrandstrstrabsent fromLibcExternspecsStringGetenv::invokePutenvNestedLeafdeclaresstrchrmodule-locallyRefs #1492, #31458, #31498, #31403