Skip to content

php-in-php: drop Type::initialize always-on file I/O ensureLinked — lazy Jit* ABI (peer #34414) #34423

Description

@PurHur

Category

Foundation · php-in-php · runtime-shrink · cold-build / #32122 .1-mint class

Problem

Type::initialize still eagerly ensureLinkeds eight file-I/O / URL runtimes on every full load path:

  • StringReadfile / StringFileGetContents / StringFilePutContents
  • MimeContentTypeRuntime / MetaTagsRuntime / StringErrorLog
  • GetHeadersRuntime / ParseUrlRuntime

Always-on NestedJIT of those ABIs vs Runtime owners that declare module-locally (getNamedFunction first) is the same .1 mint class as #31894 / #32122. Peer batches already dropped serialize (#34384) and strip_tags/uu/utf8 (#34414).

Call sites already (or will) ensureLinked before lookup: readfile.php, JitFileGetContents, JitFilePutContents, JitMimeContentType, JitGetMetaTags, JitErrorLog, JitGetHeaders, JitParseUrl.

php-src reference

PHP implementation target

  • lib/JIT/Builtin/Type.php — drop the eight eager ensureLinked calls from initialize (keep StringTime eager)
  • ext/standard/JitFileGetContents.php / JitFilePutContents.php — ensureLinked before __compiler_file_* lookup if missing
  • Unit shrink tests mirroring #34414

Repro / verify

./script/aot-smoke.sh
./script/phpunit.sh --filter 'TypeDeadTypeInitializeLazyFileIo|TypeDead(Readfile|FileGetContents|FilePutContents|MimeContentType|GetMetaTags|ErrorLog|GetHeaders|ParseUrl)Abi'
./script/docker-exec.sh -- bash -lc 'script/cold-build-check.sh'

Done when

  • Type::initialize no longer eagerly links the eight runtimes
  • file_get_contents / file_put_contents / readfile / error_log / parse_url AOT repros still work
  • aot-smoke stays 8/8; no new lib/AOT/runtime/*.c
  • No weakened gate

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