Category
php-in-php · runtime-shrink (#1492, peer #20533 / #20521 / #20308)
Problem
StreamReadRuntime, JitStreamLifecycleKernel, JitStreamBucketKernel, and JitStreamFilterKernel still gate inventory/thin deferred stubs on StreamIoRuntime::shouldDeferHeavyStreamIoEmitters() (M3 inventory + NestedJit defer bag + UserScriptAotEnv). Peer builtins already use Context::isThinStandaloneAotMain() for the same thin-standalone constraint (#16075).
Separately, ExamplesHelloWorldAotRegressionTest::testStreamIoDefersNestedJitForUserScriptAot is already red on master: it asserts the literal PHP_COMPILER_AOT_USER_SCRIPT string inside StreamIoRuntime.php, but that file routes through UserScriptAotEnv / isThinStandaloneAotMain after #20229.
| Mode |
Today |
Target |
| Embed / non-thin |
NestedJIT helpers |
unchanged |
| User-script / bootstrap thin AOT |
shouldDeferHeavyStreamIoEmitters → deferred stubs |
isThinStandaloneAotMain() → same stubs |
| Inventory emit / M3 driver |
deferred via StreamIo defer bag |
NestedJIT when not thin-standalone |
| Full standalone Context init |
stubs via standaloneInitPhase inside defer bag |
keep stubs via StreamIoRuntime::isStandaloneInitPhase() (narrow; not the M3 bag) |
php-src reference
PHP implementation target
lib/JIT/Builtin/StreamReadRuntime.php — shouldDeferInventoryEmitStubs → isThinStandaloneAotMain() \|\| isStandaloneInitPhase()
ext/standard/JitStreamLifecycleKernel.php / JitStreamBucketKernel.php / JitStreamFilterKernel.php — same gate; drop shouldDeferHeavyStreamIoEmitters call sites
lib/JIT/Builtin/StreamIoRuntime.php — add public isStandaloneInitPhase(); remove redundant UserScriptAotEnv from shouldDeferHeavyStreamIoEmitters (thin callers already use isThinStandaloneAotMain)
- Shrink tests + fix
ExamplesHelloWorldAotRegressionTest::testStreamIoDefersNestedJitForUserScriptAot
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/StreamReadRuntimeShrinkTest.php \
test/unit/StreamLifecycleRuntimeShrinkTest.php \
test/unit/StreamBucketKernelShrinkTest.php \
test/unit/StreamFilterKernelShrinkTest.php \
test/unit/StreamIoRuntimeShrinkTest.php \
test/unit/ExamplesHelloWorldAotRegressionTest.php
make bootstrap-selfhost-vm-driver-execute-probe
'
Done when
Refs #1492, #20533, #20521, #20308, #20229, #16075
Category
php-in-php· runtime-shrink (#1492, peer #20533 / #20521 / #20308)Problem
StreamReadRuntime,JitStreamLifecycleKernel,JitStreamBucketKernel, andJitStreamFilterKernelstill gate inventory/thin deferred stubs onStreamIoRuntime::shouldDeferHeavyStreamIoEmitters()(M3 inventory + NestedJit defer bag +UserScriptAotEnv). Peer builtins already useContext::isThinStandaloneAotMain()for the same thin-standalone constraint (#16075).Separately,
ExamplesHelloWorldAotRegressionTest::testStreamIoDefersNestedJitForUserScriptAotis already red on master: it asserts the literalPHP_COMPILER_AOT_USER_SCRIPTstring insideStreamIoRuntime.php, but that file routes throughUserScriptAotEnv/isThinStandaloneAotMainafter #20229.shouldDeferHeavyStreamIoEmitters→ deferred stubsisThinStandaloneAotMain()→ same stubsstandaloneInitPhaseinside defer bagStreamIoRuntime::isStandaloneInitPhase()(narrow; not the M3 bag)php-src reference
PHP implementation target
lib/JIT/Builtin/StreamReadRuntime.php—shouldDeferInventoryEmitStubs→isThinStandaloneAotMain() \|\| isStandaloneInitPhase()ext/standard/JitStreamLifecycleKernel.php/JitStreamBucketKernel.php/JitStreamFilterKernel.php— same gate; dropshouldDeferHeavyStreamIoEmitterscall siteslib/JIT/Builtin/StreamIoRuntime.php— add publicisStandaloneInitPhase(); remove redundantUserScriptAotEnvfromshouldDeferHeavyStreamIoEmitters(thin callers already useisThinStandaloneAotMain)ExamplesHelloWorldAotRegressionTest::testStreamIoDefersNestedJitForUserScriptAotRepro
Done when
shouldDeferHeavyStreamIoEmittersin StreamRead / Lifecycle / Bucket / Filter kernelsisThinStandaloneAotMain(+ init-phase only where Context still installs inventory stubs)make bootstrap-selfhost-vm-driver-execute-probegreenRefs #1492, #20533, #20521, #20308, #20229, #16075