Skip to content

php-in-php: drop Context ensureFullStandaloneBodies always-on StringGetenv/StringGetenvAll — lazy at JitEnv (ext/standard/basic_functions.c) #35127

Description

@PurHur

Category

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

Problem

Context::ensureFullStandaloneBodies still NestedJITs __compiler_getenv / __compiler_getenv_all after the standalone-init phase (always-helper #20156). Thin hello-world and scripts that never call getenv() pay that NestedJIT during full standalone init — leftover Context NestedJIT vs Runtime ABI drift mints getenv.1 / getenv_all.1 (#31894 / #32122).

Call sites already ensureLinked before lookup:

Peer ensureFull drops: #35113 RandomBytes, #35099 ExceptionBridge, #35089 Utf8/Define/…, #35086 Stream*, #35065 Json/Offset, #35073 Assert/Gc.

php-src reference

PHP implementation target

  • lib/JIT/Context.php — remove StringGetenv::ensureStandaloneBodies / StringGetenvAll::ensureStandaloneBodies from ensureFullStandaloneBodies
  • Document lazy-full on StringGetenv.php / StringGetenvAll.php
  • Guard test peer #35113 shape
  • No new runtime/*.c

Repro / verify

./script/aot-smoke.sh
./script/phpunit.sh --filter 'ContextFullStandaloneLazyGetenvShrinkTest|TypeDeadGetenvAbiRuntimeShrinkTest|StringGetenvRuntimeStandaloneTest|StringGetenvAllRuntimeStandaloneTest'
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/hw.bin -r "echo \"hi\";" && /tmp/hw.bin'

Done when

  • ensureFullStandaloneBodies does not NestedJIT getenv / getenv_all
  • ./script/aot-smoke.sh stays 8/8
  • Targeted phpunit filter green
  • Hello-world AOT still prints hi

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 / 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