Category
Foundation · php-in-php · runtime-shrink · cold-build / #32122 class
Problem
Context::ensureMinimalUserStandaloneBodies() still eagerly NestedJIT/links SuperglobalNameRuntime on every thin AOT user-script init (hello-world / aot-smoke path), even when the script never calls __compiler_is_superglobal_name:
SuperglobalNameRuntime::ensureLinked → NestedJIT SuperglobalNameJitHelper
Measured on master @ current tip: nm on AOT echo "hi" shows T __compiler_is_superglobal_name and hundreds of SuperglobalNameJitHelper string consts — waste NestedJIT during init. Same always-on NestedJIT vs Runtime ABI drift / cold-build surface class as closed #34807 (EnvLocal) / #34769 / #34642. Leftover Context NestedJIT vs Runtime ABI drift mints is_superglobal_name.1 (#31894 / #32122).
Call sites already StringSuperglobalName::ensureLinked before lookup (ext/standard/JitSuperglobalName.php, lib/JIT.php compileSuperglobalNameNative). Compile-time PHP paths use Web\Superglobals::isSuperglobalName — not the LLVM ABI.
| Repro |
Zend 8.2+ |
AOT thin hello-world |
echo "hi"; (no is_superglobal) |
hi |
must not NestedJIT SuperglobalNameJitHelper during init |
var_dump(__compiler_is_superglobal_name('_GET')); |
int(1) |
matches Zend via call-site ensureLinked |
php-src reference
PHP implementation target
lib/JIT/Context.php ensureMinimalUserStandaloneBodies — remove SuperglobalNameRuntime::ensureLinked
- Keep call-site
StringSuperglobalName::ensureLinked / JitSuperglobalName
- Keep
CliArgvRuntime::ensureStandaloneBodies in minimal (argv still needed before {main})
- 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 'echo '\''<?php echo "hi\n";'\'' > /tmp/hw.php && php bin/compile.php -o /tmp/hw.bin /tmp/hw.php && nm /tmp/hw.bin | grep -c SuperglobalNameJitHelper || true'
Done when
Category
Foundation· php-in-php · runtime-shrink · cold-build / #32122 classProblem
Context::ensureMinimalUserStandaloneBodies()still eagerly NestedJIT/linksSuperglobalNameRuntimeon every thin AOT user-script init (hello-world / aot-smoke path), even when the script never calls__compiler_is_superglobal_name:SuperglobalNameRuntime::ensureLinked→ NestedJITSuperglobalNameJitHelperMeasured on master @ current tip:
nmon AOTecho "hi"showsT __compiler_is_superglobal_nameand hundreds ofSuperglobalNameJitHelperstring consts — waste NestedJIT during init. Same always-on NestedJIT vs Runtime ABI drift / cold-build surface class as closed#34807(EnvLocal) /#34769/#34642. Leftover Context NestedJIT vs Runtime ABI drift mintsis_superglobal_name.1(#31894 / #32122).Call sites already
StringSuperglobalName::ensureLinkedbefore lookup (ext/standard/JitSuperglobalName.php,lib/JIT.phpcompileSuperglobalNameNative). Compile-time PHP paths useWeb\Superglobals::isSuperglobalName— not the LLVM ABI.echo "hi";(no is_superglobal)var_dump(__compiler_is_superglobal_name('_GET'));php-src reference
Zend/zend_compile.c—zend_is_auto_global_str#34807EnvLocal lazy;#33235Type always-on__compiler_is_superglobal_nameshell dropPHP implementation target
lib/JIT/Context.phpensureMinimalUserStandaloneBodies— removeSuperglobalNameRuntime::ensureLinkedStringSuperglobalName::ensureLinked/JitSuperglobalNameCliArgvRuntime::ensureStandaloneBodiesin minimal (argv still needed before{main})./script/aot-smoke.sh8/8Repro
Done when
ensureMinimalUserStandaloneBodiesdoes not callSuperglobalNameRuntime::ensureLinkedSuperglobalNameJitHelper(no__compiler_is_superglobal_namefrom eager init)__compiler_is_superglobal_name('_GET')still matches Zend via call-site ensureLinked./script/aot-smoke.shstill 8/8