Category
Foundation · php-in-php · runtime-shrink · cold-build / #32122 class
Problem
Context::ensureMinimalUserStandaloneBodies() still eagerly NestedJIT/links JitReturnPending on every thin AOT user-script init (hello-world / aot-smoke path), even when the script never uses try/finally return-through-finally:
JitReturnPending::ensureStandaloneBodies → ReturnPendingRuntime → JitHelperAbiBridge::implement (ends with clearInsertionPosition())
Same always-on NestedJIT vs Runtime ABI drift / cold-build surface class as closed #34612 / #34605 / #32122 .1-mint risk.
Call sites already ensure before use:
lib/JIT/TryCatchHelper.php — beginTry / return-through-finally → JitReturnPending::ensureLinked
lib/JIT.php — emitPendingReturnResume → JitReturnPending::ensureLinked
JitHelperAbiBridge::implement must capture/restore builder insert (peer ErrorHandlerJitRuntime / #34612) so mid-{main} ensureLinked is safe — today it always clearInsertionPosition(), which is why this stayed always-on.
php-src reference
PHP implementation target
Repro
./script/aot-smoke.sh
./script/docker-exec.sh -- bash -lc 'script/cold-build-check.sh'
./script/phpunit.sh --filter 'ContextMinimalStandaloneLazyReturnPending|ContextMinimalStandaloneLazyHtmlErrorHandler|ExamplesHelloWorldAot'
./script/docker-exec.sh -- bash -lc 'printf "%s\n" "<?php function f(){ try { return 1; } finally { echo \"f\"; } } echo f(), \"\n\";" >/tmp/rp.php && php bin/compile.php -o /tmp/rp.bin /tmp/rp.php && /tmp/rp.bin'
Done when
Parent
Category
Foundation· php-in-php · runtime-shrink · cold-build / #32122 classProblem
Context::ensureMinimalUserStandaloneBodies()still eagerly NestedJIT/linksJitReturnPendingon every thin AOT user-script init (hello-world / aot-smoke path), even when the script never uses try/finally return-through-finally:JitReturnPending::ensureStandaloneBodies→ReturnPendingRuntime→JitHelperAbiBridge::implement(ends withclearInsertionPosition())Same always-on NestedJIT vs Runtime ABI drift / cold-build surface class as closed
#34612/#34605/#32122.1-mint risk.Call sites already ensure before use:
lib/JIT/TryCatchHelper.php—beginTry/ return-through-finally →JitReturnPending::ensureLinkedlib/JIT.php—emitPendingReturnResume→JitReturnPending::ensureLinkedJitHelperAbiBridge::implementmust capture/restore builder insert (peerErrorHandlerJitRuntime/#34612) so mid-{main}ensureLinkedis safe — today it alwaysclearInsertionPosition(), which is why this stayed always-on.php-src reference
Zend/zend_execute.c— return-through-finallyPHP implementation target
lib/JIT/Builtin/JitHelperAbiBridge.php— capture/restore insert around implement (do not always clear)lib/JIT/Context.php— removeJitReturnPending::ensureStandaloneBodiesfromensureMinimalUserStandaloneBodies(); keep htmlspecialchars / echo / trigger_error / argv / getenv / last-error / ObOutput / ExceptionBridge / ErrorBridge essentialsContextMinimalStandaloneLazyReturnPendingRuntimeShrinkTest(peer php-in-php: drop Context ensureMinimalUserStandaloneBodies always-on HtmlEntities/Decode/ErrorHandler/ExceptionHandler — lazy at call sites (peer #34605) #34612)runtime/*.c/lib/AOT/runtime/*.cRepro
Done when
ensureMinimalUserStandaloneBodiesdoes not eagerly linkJitReturnPendingJitHelperAbiBridge::implementrestores insert when one was activelib/AOT/runtime/Parent