Skip to content

php-in-php: drop Context ensureMinimalUserStandaloneBodies always-on EnvLocalRuntime — dead __compiler_env_local_* NestedJIT (peer #34769 / #34513) #34807

Description

@PurHur

Category

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

Problem

Context::ensureMinimalUserStandaloneBodies still eagerly EnvLocalRuntime::ensureLinked (→ JitEnvLocalKernel NestedJIT of __compiler_env_local_lookup / __compiler_env_register_putenv + StringGetenv::ensureJitHelperCompiled).

Thin AOT hello-world NestedJITs that ABI on every compile even though no call site looks up __compiler_env_local_* anymore — getenv() / putenv() lower via StringGetenv / PutenvJitHelper / GetenvLookupJitHelper (#32665 / #23414 / #29313). Type always-on shells were already dropped (#32729 / #34513); Context ensureMinimal is the leftover always-on.

Leftover Context NestedJIT vs Runtime ABI drift mints env_local_lookup.1 (#31894 / #32122).

php-src reference

PHP implementation target

  • lib/JIT/Context.php — remove EnvLocalRuntime::ensureLinked from ensureMinimalUserStandaloneBodies (keep ensureBootstrapAotStubLinked on bootstrap-aot path)
  • Call-site: StringGetenv / JitEnv already own getenv/putenv; leave EnvLocalRuntime::ensureLinked callable for explicit use
  • Unit shrink tests: stop requiring EnvLocal in minimal; add dedicated shrink test
  • No new lib/AOT/runtime/*.c (floor already empty; phpc_env_local.c must stay absent)

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 ContextMinimalStandaloneLazyEnvLocal|TypeDeadEnvLocal|EnvLocalRuntimeShrink

Done when

  • Thin hello-world AOT compiles without eager EnvLocal NestedJIT in ensureMinimal
  • ./script/aot-smoke.sh stays 8/8
  • Unit shrink tests updated; no new lib/AOT/runtime/*.c
  • bootstrap-aot stub path still ensureBootstrapAotStubLinked

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