Skip to content

php-in-php: lazy ExceptionBridge/ErrorBridge + dead string NestedJIT from ensureFullStandaloneBodies (Context.php) #35099

Description

@PurHur

Category

php-in-php · runtime-shrink · Pillar Trust (#32122 .1 mint class)

Problem

Context::ensureFullStandaloneBodies still eagerly NestedJITs pending-exception / pending-Error ABIs during every full standalone init — peers already made these lazy on the minimal path (#34732 ExceptionBridge / #34769 ErrorBridge):

  1. ExceptionBridge::ensureStandaloneBodies (→ TypeErrorRaise / JitThrow; replaces lib/AOT/runtime/phpc_type_error_raise.c)
  2. ErrorBridge::ensureStandaloneBodies (→ ErrorRaise / AssertionErrorRaise / ReadonlyRaise; replaces lib/AOT/runtime/phpc_error_raise.c)

Standalone {main} already ErrorBridge::ensureLinked / ExceptionBridge::emitClear|emitAbortensureLinked before lookup. Leftover Context NestedJIT vs Runtime ABI drift mints type_error_*.1 / error_*.1 (#31894 / #32122).

Also delete the string-helpers NestedJIT block gated on !isStandaloneInitPhase()ensureFull always beginStandaloneInitPhase() first, so Soundex/Quotemeta/… never run; call sites already ensureLinked (peer ensureMinimal #34578).

php-src reference

PHP implementation target

  • lib/JIT/Context.php — drop always-on ExceptionBridge/ErrorBridge NestedJIT from ensureFullStandaloneBodies; delete dead string-helpers gate block
  • Update ContextMinimalStandaloneLazyExceptionBridgeRuntimeShrinkTest / ErrorBridge peers that still assert ensureFull keeps them
  • New ContextFullStandaloneLazyExceptionErrorBridgeRuntimeShrinkTest

Repro / verify

./script/phpunit.sh --filter 'ContextFullStandaloneLazyExceptionErrorBridge|ContextMinimalStandaloneLazyExceptionBridge|ContextMinimalStandaloneLazyErrorBridge|ContextFullStandaloneLazyStdlib'
./script/docker-exec.sh -- bash -lc './script/aot-smoke.sh'

Done when

  • ensureFullStandaloneBodies has no ExceptionBridge::ensureStandaloneBodies / ErrorBridge::ensureStandaloneBodies
  • Dead Soundex…ParseStr NestedJIT block removed from ensureFull
  • Unit shrink guards green; ./script/aot-smoke.sh stays 8/8
  • No new lib/AOT/runtime/*.c

Parent

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