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
Parent
Category
Foundation· php-in-php · runtime-shrink · cold-build / #32122 .1-mint classProblem
Type::initializestill eagerlyensureLinkeds eight stream orchestrators on every full load path:StreamSync/StreamIo/StreamCaps/StreamLifecycleStreamBuffer/StreamMeta/StreamRead/StreamResourceAlways-on NestedJIT of those ABIs vs Runtime owners that declare module-locally (
getNamedFunctionfirst) is the same.1mint 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)
ensureLinkedbefore 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/StringStreamCsvstay for a later peer.php-src reference
ext/standard/file.c— fopen/fread/fwrite/fclose/feof/…ext/standard/streamsfuncs.c— stream_* probesPHP implementation target
lib/JIT/Builtin/Type.php— drop the eight always-onensureLinkedcalls; document peer php-in-php: drop Type::initialize always-on strtr/phpinfo/dir/fs/iterator ensureLinked — lazy Jit* ABI (peer #34423) #34433ensureLinkedwhere invoke looks up ABI without linking (e.g.JitFeof)runtime/*.c)TypeDeadTypeInitializeLazyStreamRuntimeShrinkTest; flipStillEnsureLinksStream*unit assertsRepro
Done when
Type::initializeno longer eagerly links the eight Stream* orchestrators aboveensureLinkedcoverage retained (unit guard);JitFeoflinks before lookuplib/AOT/runtime/*.cfor these ABIs./script/aot-smoke.shstays 8/8Parent