Category
Foundation · php-in-php · runtime-shrink · cold-build / #32122 class
Problem
Context::ensureMinimalUserStandaloneBodies() still eagerly CliArgvRuntime::ensureStandaloneBodies on every thin AOT user-script init (hello-world / aot-smoke path), even though:
compileToFile already CliArgvRuntime::ensureStandaloneBodies before __phpc_cli_store_argv for thin standalone
CliArgvGlobalInit::{load,loadArgc,emitRefreshAfterStoreArgv} already CliArgvRuntime::ensureLinked before lookup
JitGetopt already CliArgvRuntime::ensureLinked
Always-on during init is the same leftover NestedJIT / ABI-link surface class as closed #34812 (SuperglobalName) / #34807 (EnvLocal). Mid-{main} ensureLinked without insert-block restore orphans calls / fails Module.php:180 (#27317 / #34812).
CliArgvRuntime no longer NestedJITs CliArgvJitHelper (pure LLVM refresh); keep ABI in the binary via compileToFile + call sites — just not during ensureMinimal init.
| Repro |
Zend 8.2+ |
AOT thin hello-world |
echo "hi"; (no $argv) |
hi |
must not eagerly link CliArgv during ensureMinimal |
echo $argc; |
1 |
matches Zend via call-site / compileToFile ensureLinked |
php-src reference
PHP implementation target
lib/JIT/Context.php ensureMinimalUserStandaloneBodies — remove CliArgvRuntime::ensureStandaloneBodies
lib/JIT/Builtin/CliArgvRuntime.php — save/restore insert block on implement() (peer MetaTags #27317 / #34812)
- Keep
compileToFile thin ensure + ensureFullStandaloneBodies / bootstrap-aot
- Update peer shrink keep-lists + unit shrink test
./script/aot-smoke.sh 8/8
Repro
./script/aot-smoke.sh
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
echo '\''<?php echo "hi\n";'\'' > /tmp/hw.php
php bin/compile.php -o /tmp/hw.bin /tmp/hw.php && /tmp/hw.bin
echo '\''<?php echo $argc, "\n";'\'' > /tmp/av.php
php bin/compile.php -o /tmp/av.bin /tmp/av.php && /tmp/av.bin'
Done when
Parent / peers
#32122 cold-build / *.1 mint class
#34812 SuperglobalName; #34807 EnvLocal; #34463 Type CliArgv
Category
Foundation· php-in-php · runtime-shrink · cold-build / #32122 classProblem
Context::ensureMinimalUserStandaloneBodies()still eagerlyCliArgvRuntime::ensureStandaloneBodieson every thin AOT user-script init (hello-world / aot-smoke path), even though:compileToFilealreadyCliArgvRuntime::ensureStandaloneBodiesbefore__phpc_cli_store_argvfor thin standaloneCliArgvGlobalInit::{load,loadArgc,emitRefreshAfterStoreArgv}alreadyCliArgvRuntime::ensureLinkedbefore lookupJitGetoptalreadyCliArgvRuntime::ensureLinkedAlways-on during init is the same leftover NestedJIT / ABI-link surface class as closed
#34812(SuperglobalName) /#34807(EnvLocal). Mid-{main}ensureLinked without insert-block restore orphans calls / failsModule.php:180(#27317 / #34812).CliArgvRuntimeno longer NestedJITsCliArgvJitHelper(pure LLVM refresh); keep ABI in the binary viacompileToFile+ call sites — just not during ensureMinimal init.echo "hi";(no$argv)echo $argc;1php-src reference
ext/standard/basic_functions.c—$argc/$argvCLI SAPI#34812SuperglobalName lazy;#34807EnvLocal lazy;#34463Type::initialize CliArgv dropPHP implementation target
lib/JIT/Context.phpensureMinimalUserStandaloneBodies— removeCliArgvRuntime::ensureStandaloneBodieslib/JIT/Builtin/CliArgvRuntime.php— save/restore insert block onimplement()(peer MetaTags#27317/#34812)compileToFilethin ensure +ensureFullStandaloneBodies/ bootstrap-aot./script/aot-smoke.sh8/8Repro
Done when
ensureMinimalUserStandaloneBodiesdoes not callCliArgvRuntime::ensureStandaloneBodies$argcAOT still match Zend;aot-smoke8/8{main}$argvensureLinked restores insert block (no Module.php:180)lib/AOT/runtime/*.cParent / peers
#32122cold-build /*.1mint class#34812SuperglobalName;#34807EnvLocal;#34463Type CliArgv