Skip to content

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

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, finish #19279 / Unlink pattern #19186)

Problem

lib/JIT/Builtin/StringFileGetContents.php still routes UserScriptAotDeferNestedJit::shouldDefer() through ext/standard/JitFileGetContentsKernel.php (~185 LOC hand-written libc open/read LLVM). Embed already uses FileGetContentsJitHelperVmFs::fileGetContents().

Committed helper-runtime unit ext_standard_FileGetContentsJitHelper_php already exists with runtime_safe: true — same prelink that made Unlink (#19186) drop its libc defer. Kernel can go.

php-src reference

PHP implementation target

  • lib/JIT/Builtin/StringFileGetContents.php — always JitVmHelperLink::ensureBridge (drop defer → kernel)
  • Delete ext/standard/JitFileGetContentsKernel.php
  • Update test/unit/FileGetContentsRuntimeShrinkTest.php + spine require list
  • SSOT remains ext/standard/FileGetContentsJitHelper.phpVmFs::fileGetContents()

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/FileGetContentsRuntimeShrinkTest.php
tmpdir=$(mktemp -d); echo hi > "$tmpdir/x"
PHP_COMPILER_AOT_USER_SCRIPT=1 php bin/compile.php -o "$tmpdir/fgc" -r "echo file_get_contents(\"$tmpdir/x\");"
"$tmpdir/fgc"
make bootstrap-selfhost-vm-driver-execute-probe
'

Done when

  • JitFileGetContentsKernel.php deleted
  • UserScriptAotDeferNestedJit removed from StringFileGetContents bridge path
  • User-script AOT file_get_contents smoke prints file contents
  • FileGetContentsRuntimeShrinkTest green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites lines removed

Refs #1492, #15309, #19186, #19279

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions