Skip to content

php-in-php: drop Type::initialize always-on Stream* ensureLinked — lazy Jit* ABI (peer #34433) #34439

Description

@PurHur

Category

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

Problem

Type::initialize still eagerly ensureLinkeds eight stream orchestrators on every full load path:

  • StreamSync / StreamIo / StreamCaps / StreamLifecycle
  • StreamBuffer / StreamMeta / StreamRead / StreamResource

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 file I/O (#34423), strip_tags/uu/utf8 (#34414), and strtr/phpinfo/dir/fs/iterator (#34433).

Call sites already (or will) ensureLinked before lookup: JitFsync/JitFdatasync, JitFopen/JitFwrite/JitFread/JitTmpfile/JitPopen, JitStreamIsLocal/JitStreamIsatty/JitStreamSupports, JitFclose/JitFeof/JitFflush/JitIsResource/JitPclose, JitStreamSet*, JitStreamGetMetaData/JitStreamSetBlocking, JitFgetc/JitFgets/JitFseek/JitFtell/…, JitGetResourceType/JitGetResources.

StringTime / Stat* / Stats / StreamGlobals / GzStreamIo / Bz2StreamIo / StringStreamCsv stay for a later peer.

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc './script/aot-smoke.sh'
# must stay 8/8; then targeted shrink + feof/fopen smoke
./script/phpunit.sh --filter 'TypeDeadTypeInitializeLazyStream|TypeDead(Feof|Fopen|Fclose|Fwrite|Fread|StreamSupports|StreamIsatty|Fsync|Fdatasync|GetResourceType)Abi'

Done when

  • Type::initialize no longer eagerly links the eight Stream* orchestrators above
  • Call-site ensureLinked coverage retained (unit guard); JitFeof links before lookup
  • No new lib/AOT/runtime/*.c for these ABIs
  • ./script/aot-smoke.sh stays 8/8
  • Targeted phpunit green

Parent

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