Skip to content

php-in-php: delete JitFileGetContentsKernel — always JitVmHelperLink + FileGetContentsJitHelper PHP (#19339) - #19956

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-delete-fgc-kernel
Jul 17, 2026
Merged

php-in-php: delete JitFileGetContentsKernel — always JitVmHelperLink + FileGetContentsJitHelper PHP (#19339)#19956
PurHur merged 1 commit into
masterfrom
agent/runtime-php-delete-fgc-kernel

Conversation

@PurHur

@PurHur PurHur commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Delete ext/standard/JitFileGetContentsKernel.php (185 LOC libc open/read LLVM kernel)
  • Remove UserScriptAotDeferNestedJit defer path from StringFileGetContents — user-script AOT now routes through the same JitVmHelperLink + FileGetContentsJitHelperVmFs::fileGetContents() PHP bridge as embed mode
  • Net: -232 lines of hand-written LLVM; file_get_contents is now fully PHP-in-PHP

Changes

File Change
ext/standard/JitFileGetContentsKernel.php Deleted (185 lines)
lib/JIT/Builtin/StringFileGetContents.php Removed implementUserScriptKernel(), UserScriptAotDeferNestedJit import, LibcExtern import, KERNEL_ENTRY const; implement() always calls implementPhpBridge()
test/unit/FileGetContentsRuntimeShrinkTest.php Updated assertions: kernel file must not exist, no UserScriptAotDeferNestedJit in bridge
test/selfhost/compiler_lib_spine_smoke/main.php Removed kernel require; added mb_strstr.php (spine sync fix for #19942)
docs/bootstrap-inventory.md Regenerated (5330 files)

php-src reference

  • ext/standard/file.c / streamsfuncs.cPHP_FUNCTION(file_get_contents) / php_stream_copy_to_mem

Verification

vendor/bin/phpunit test/unit/FileGetContentsRuntimeShrinkTest.php — OK (4 tests, 16 assertions)
make bootstrap-selfhost-vm-driver-execute-probe — OK
php script/bootstrap-inventory.php --check — OK 5330/5330
php script/check-selfhost-spine-coverage-sync.php — OK

Closes #19339
Refs #1492, #15309, #19186, #19279

Made with Cursor

…+ FileGetContentsJitHelper PHP (#19339)

Remove the ~185 LOC libc open/read LLVM kernel from ext/standard/JitFileGetContentsKernel.php.
StringFileGetContents now always routes through FileGetContentsJitHelper → VmFs::fileGetContents()
via JitVmHelperLink, matching the Unlink pattern (#19186).

- Delete ext/standard/JitFileGetContentsKernel.php (185 lines removed)
- Remove UserScriptAotDeferNestedJit defer path from StringFileGetContents
- Remove implementUserScriptKernel() method entirely
- Remove kernel from spine require list; add mb_strstr.php (sync fix for #19942)
- Update FileGetContentsRuntimeShrinkTest to assert kernel deletion
- Regenerate bootstrap-inventory.md

Verification:
  vendor/bin/phpunit test/unit/FileGetContentsRuntimeShrinkTest.php — OK (4 tests, 16 assertions)
  make bootstrap-selfhost-vm-driver-execute-probe — OK
  php script/bootstrap-inventory.php --check — OK 5330/5330
  php script/check-selfhost-spine-coverage-sync.php — OK

Closes #19339

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 5063fe4 into master Jul 17, 2026
1 check failed
@PurHur
PurHur deleted the agent/runtime-php-delete-fgc-kernel branch July 17, 2026 08:13
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: delete JitFileGetContentsKernel — always JitVmHelperLink + FileGetContentsJitHelper PHP (#1492)

1 participant