Skip to content

php-in-php: drop Context ensureMinimalUserStandaloneBodies always-on ErrorBridge — lazy at ErrorRaise/ReadonlyRaise call sites (peer #34732) #34769

Description

@PurHur

Category

enhancement · php-in-php · runtime-shrink / NestedJIT · peer #34732 / #34695 · cold-build .1 mint class (#32122 / #31894)

Problem

Context::ensureMinimalUserStandaloneBodies still eagerly ErrorBridge::ensureStandaloneBodies (AssertionErrorRaise + ErrorRaise + ReadonlyBridge). Thin AOT hello-world NestedJITs pending-Error ABI during init even when {main} never raises.

Leftover Context NestedJIT vs Runtime ABI drift mints *.1 and fails module verify at vendor/ircmaxell/php-llvm/lib/LLVMAbstract/Module.php:180 (same class as #32122).

ExceptionBridge was already made lazy (#34732). ErrorBridge is the next always-on sibling in ensureMinimal.

PHP implementation target

  • lib/JIT/Context.php — remove ErrorBridge::ensureStandaloneBodies from ensureMinimalUserStandaloneBodies (keep in ensureFullStandaloneBodies)
  • lib/JIT/Builtin/ErrorRaise.php / AssertionErrorRaise.phpensureLinked implements standalone bodies; emitClear/emitAbort/emitRaise call ensureLinked before lookup
  • lib/JIT/Builtin/ReadonlyRaise.phpemitClear/emitAbort call ensureLinked before lookup
  • No new runtime/*.c (floor already empty; ErrorBridge replaced phpc_error_raise.c)

Repro / verify

./script/aot-smoke.sh
./script/docker-exec.sh -- bash -lc 'printf "%s\n" "<?php echo \"hello\n\";" > /tmp/h.php; PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o /tmp/h.bin /tmp/h.php && /tmp/h.bin'
./script/phpunit.sh --filter ContextMinimalStandaloneLazyErrorBridge

Done when

  • Thin hello-world AOT compiles without eager ErrorBridge NestedJIT in ensureMinimal
  • ./script/aot-smoke.sh stays 8/8
  • Unit shrink tests + no new lib/AOT/runtime/*.c
  • ensureFull still ensures ErrorBridge

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