Skip to content

php-in-php: drop shouldDeferHeavyStreamIoEmitters from JitEnv putenv — thin via isThinStandaloneAotMain (#1492) #20499

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer ObOutput #20443 / PendingHeaders #20420 / getenv #20156)

Problem

ext/standard/JitEnv.php still gates deferred user-script / inventory putenv on StreamIoRuntime::shouldDeferHeavyStreamIoEmitters() (inventory-emit + NestedJit defer bag + standaloneInitPhase). Peer getenv (#20156) and ObOutput (#20443) already use Context::isThinStandaloneAotMain() for the same thin-standalone constraint (#16075 / #13571 / #17316).

Under M3 inventory emit / standaloneInitPhase the StreamIo defer bag forces libc-only setenv and skips GetenvJitHelper::putenv NestedJIT when not thin-standalone — so putenv overlay / syntax path stays stubbed broader than necessary.

Mode Today Target
Embed / non-thin GetenvJitHelper::putenv + libc mirror unchanged
User-script / bootstrap thin AOT shouldDeferHeavyStreamIoEmitters → libc-only (emitLibcPutenvMirror) isThinStandaloneAotMain() → same libc-only (#17316)
Inventory emit / M3 driver / standaloneInitPhase deferred via StreamIo defer bag (libc-only) honest NestedJIT helper + libc mirror when not thin

php-src reference

PHP implementation target

  • ext/standard/JitEnv.php — gate libc-only putenv / skip-helper on $context->isThinStandaloneAotMain(); drop shouldDeferHeavyStreamIoEmitters (and unused StreamIoRuntime import if unused)
  • test/unit/PutenvRuntimeShrinkTest.php (new) — assert isThinStandaloneAotMain on JitEnv, no shouldDeferHeavyStreamIoEmitters

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/PutenvRuntimeShrinkTest.php
vendor/bin/phpunit test/unit/GetenvJitRuntimeShrinkTest.php
make bootstrap-selfhost-vm-driver-execute-probe
'

Done when

  • shouldDeferHeavyStreamIoEmitters removed from JitEnv.php
  • Thin path gated on isThinStandaloneAotMain only (libc-only retained for thin AOT)
  • Shrink test green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites defer-gate lines removed

Refs #1492, #20156, #20443, #17316, #9092

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