Skip to content

php-in-php: drop Context ensureMinimalUserStandaloneBodies always-on ExceptionBridge — lazy at TypeErrorRaise call sites (peer #34695) #34732

Description

@PurHur

Category

php-in-php · runtime-shrink · thin AOT init (#32122 .1 mint class)

Problem

Context::ensureMinimalUserStandaloneBodies() still eagerly ExceptionBridge::ensureStandaloneBodies() during thin standalone init. That NestedJITs TypeErrorRaise / JitThrow ABI for every hello-world AOT binary even though the thin {main} path never clears/aborts TypeError pending (isThinStandaloneAotMain skips ExceptionBridge::emitClear / emitAbort).

Peer shrinks (#34578#34695) already moved NestedJIT ABIs to call-site ensureLinked. Leftover Context NestedJIT vs Runtime ABI drift mints *.1 (#31894 / #32122).

Surface Today After
thin hello-world init eagerly TypeErrorRaise + JitThrow no ExceptionBridge during init
TypeError / illegal offset / throw works (always-on) works (TypeErrorRaise::ensureLinked implements standalone bodies)

php-src reference

PHP implementation target

  • lib/JIT/Builtin/TypeErrorRaise.phpensureLinked implements bodies for STANDALONE too (restore insert block like ErrorRaise); emitClear/emitAbort ensure before lookup
  • lib/JIT/Context.php — drop always-on ExceptionBridge::ensureStandaloneBodies from ensureMinimalUserStandaloneBodies (keep in ensureFullStandaloneBodies)
  • Update ContextMinimalStandaloneLazy* keep-lists + new shrink test
  • No new runtime/*.c

Repro / Done when

  • ensureMinimalUserStandaloneBodies has no ExceptionBridge::ensureStandaloneBodies
  • ./script/aot-smoke.sh stays 8/8
  • php bin/compile.php -o /tmp/h.bin -r 'echo "hi\n";' && /tmp/h.binhi
  • TypeError AOT smoke still aborts (e.g. illegal offset / appendChild null catchable where already covered)
  • ./script/phpunit.sh --filter 'ContextMinimalStandaloneLazy|ExceptionBridgeRuntimeShrink' green
  • No new runtime/*.c

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions