Skip to content

php-in-php: drop Context ensureFullStandaloneBodies always-on SuperglobalRefreshRuntime — lazy at compileToFile (main/php_variables.c) #35137

Description

@PurHur

Category

bug · php-in-php · Trust / #32122 .1 mint class · ensureFullStandaloneBodies shrink

Problem

Context::ensureFullStandaloneBodies still NestedJITs SuperglobalRefreshRuntime (__superglobals__refresh) during full standalone init. Every full standalone pays that during init — leftover Context NestedJIT vs Runtime ABI drift mints superglobals_refresh.1 (#31894 / #32122).

Peer #35133 already deferred CliArgv to compileToFile for every LOAD_TYPE_STANDALONE. Thin path already uses ensureUserScriptRefreshEmit before main. Full path still ensures inside ensureFullStandaloneBodies.

Call sites / main already need the symbol before lookup:

  • compileToFile standalone main calls lookupFunction('__superglobals__refresh')
  • thin: SuperglobalRefreshRuntime::ensureUserScriptRefreshEmit
  • JIT.php ensureLinked before resolve
  • bootstrap-aot: ensureBootstrapAotStandaloneBodies keeps fixtures linked

php-src reference

PHP implementation target

Repro

./script/aot-smoke.sh   # must stay 8/8
./script/phpunit.sh --filter ContextFullStandaloneLazySuperglobalRefresh

Done when

  • ensureFullStandaloneBodies does not call SuperglobalRefreshRuntime::ensureStandaloneBodies / ensureLinked
  • compileToFile ensures SuperglobalRefresh for all standalone before __superglobals__refresh
  • ./script/aot-smoke.sh → 8/8
  • Unit shrink test 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 / JITbugSomething isn't workingimplementation-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