Category
php-in-php · runtime-shrink (#1492, same pattern as #19186 unlink / #19215 rename)
Problem
lib/JIT/Builtin/StringFileGetContents.php still routes UserScriptAotDeferNestedJit::shouldDefer() through StringFileGetContentsLibc (~211 LOC hand-written libc open/read LLVM). Embed/full JIT already uses FileGetContentsJitHelper → VmFs::fileGetContents(). FileGetContentsJitHelper is already present in prelinked/helper-runtime/.../units (same cache Unlink used successfully after #19186).
php-src reference
PHP implementation target
lib/JIT/Builtin/StringFileGetContents.php — always JitVmHelperLink::ensureBridge (drop defer → Libc early-return)
- Delete
lib/JIT/Builtin/StringFileGetContentsLibc.php
- Update
test/unit/FileGetContentsRuntimeShrinkTest.php + spine require list
- Keep SSOT:
ext/standard/FileGetContentsJitHelper.php → VmFs::fileGetContents()
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/FileGetContentsRuntimeShrinkTest.php
vendor/bin/phpunit test/aot/AotTest.php --filter "data set \\\"file_get_contents\\\""
tmpdir=$(mktemp -d)
echo hi > "$tmpdir/x"
php bin/compile.php -o "$tmpdir/fgc" -r "echo file_get_contents(\"$tmpdir/x\");"
"$tmpdir/fgc"
'
Done when
Refs #1492, #15309, #17036, #19186
Category
php-in-php· runtime-shrink (#1492, same pattern as #19186 unlink / #19215 rename)Problem
lib/JIT/Builtin/StringFileGetContents.phpstill routesUserScriptAotDeferNestedJit::shouldDefer()throughStringFileGetContentsLibc(~211 LOC hand-written libcopen/readLLVM). Embed/full JIT already usesFileGetContentsJitHelper→VmFs::fileGetContents().FileGetContentsJitHelperis already present inprelinked/helper-runtime/.../units(same cache Unlink used successfully after #19186).php-src reference
PHP_FUNCTION(file_get_contents)/php_stream_copy_to_memPHP implementation target
lib/JIT/Builtin/StringFileGetContents.php— alwaysJitVmHelperLink::ensureBridge(drop defer → Libc early-return)lib/JIT/Builtin/StringFileGetContentsLibc.phptest/unit/FileGetContentsRuntimeShrinkTest.php+ spine require listext/standard/FileGetContentsJitHelper.php→VmFs::fileGetContents()Repro
Done when
StringFileGetContentsLibc.phpdeletedUserScriptAotDeferNestedJitremoved fromStringFileGetContentsbridge pathfile_get_contentsfixture greenmake bootstrap-selfhost-vm-driver-execute-probegreenRefs #1492, #15309, #17036, #19186