Category
php-in-php · runtime-shrink (#1492, peer ObOutput #20443 / PendingHeaders #20420 / getenv #20156)
Problem
ext/standard/JitEnv.php still gates deferred user-script / inventory putenv on StreamIoRuntime::shouldDeferHeavyStreamIoEmitters() (inventory-emit + NestedJit defer bag + standaloneInitPhase). Peer getenv (#20156) and ObOutput (#20443) already use Context::isThinStandaloneAotMain() for the same thin-standalone constraint (#16075 / #13571 / #17316).
Under M3 inventory emit / standaloneInitPhase the StreamIo defer bag forces libc-only setenv and skips GetenvJitHelper::putenv NestedJIT when not thin-standalone — so putenv overlay / syntax path stays stubbed broader than necessary.
| Mode |
Today |
Target |
| Embed / non-thin |
GetenvJitHelper::putenv + libc mirror |
unchanged |
| User-script / bootstrap thin AOT |
shouldDeferHeavyStreamIoEmitters → libc-only (emitLibcPutenvMirror) |
isThinStandaloneAotMain() → same libc-only (#17316) |
| Inventory emit / M3 driver / standaloneInitPhase |
deferred via StreamIo defer bag (libc-only) |
honest NestedJIT helper + libc mirror when not thin |
php-src reference
PHP implementation target
ext/standard/JitEnv.php — gate libc-only putenv / skip-helper on $context->isThinStandaloneAotMain(); drop shouldDeferHeavyStreamIoEmitters (and unused StreamIoRuntime import if unused)
test/unit/PutenvRuntimeShrinkTest.php (new) — assert isThinStandaloneAotMain on JitEnv, no shouldDeferHeavyStreamIoEmitters
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/PutenvRuntimeShrinkTest.php
vendor/bin/phpunit test/unit/GetenvJitRuntimeShrinkTest.php
make bootstrap-selfhost-vm-driver-execute-probe
'
Done when
Refs #1492, #20156, #20443, #17316, #9092
Category
php-in-php· runtime-shrink (#1492, peer ObOutput #20443 / PendingHeaders #20420 / getenv #20156)Problem
ext/standard/JitEnv.phpstill gates deferred user-script / inventory putenv onStreamIoRuntime::shouldDeferHeavyStreamIoEmitters()(inventory-emit + NestedJit defer bag +standaloneInitPhase). Peer getenv (#20156) and ObOutput (#20443) already useContext::isThinStandaloneAotMain()for the same thin-standalone constraint (#16075 / #13571 / #17316).Under M3 inventory emit /
standaloneInitPhasethe StreamIo defer bag forces libc-onlysetenvand skipsGetenvJitHelper::putenvNestedJIT when not thin-standalone — so putenv overlay / syntax path stays stubbed broader than necessary.GetenvJitHelper::putenv+ libc mirrorshouldDeferHeavyStreamIoEmitters→ libc-only (emitLibcPutenvMirror)isThinStandaloneAotMain()→ same libc-only (#17316)php-src reference
ext/standard/basic_functions.c—zif_putenv/zif_getenvPHP implementation target
ext/standard/JitEnv.php— gate libc-only putenv / skip-helper on$context->isThinStandaloneAotMain(); dropshouldDeferHeavyStreamIoEmitters(and unusedStreamIoRuntimeimport if unused)test/unit/PutenvRuntimeShrinkTest.php(new) — assertisThinStandaloneAotMainon JitEnv, noshouldDeferHeavyStreamIoEmittersRepro
Done when
shouldDeferHeavyStreamIoEmittersremoved fromJitEnv.phpisThinStandaloneAotMainonly (libc-only retained for thin AOT)make bootstrap-selfhost-vm-driver-execute-probegreenRefs #1492, #20156, #20443, #17316, #9092