Skip to content

php-in-php: drop standaloneInitPhase from shouldDeferHeavyStreamIoEmitters — StreamIoJit gates init-phase; delete dead JitStreamIoKernel::implement (#1492) #20576

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer #20571 / #20553)

Problem

After #20553 / #20571, stream inventory kernels and Context string helpers already gate on isThinStandaloneAotMain() / isStandaloneInitPhase() — not the broad StreamIo M3 defer bag. StreamIoRuntime::shouldDeferHeavyStreamIoEmitters() still folds $standaloneInitPhase into the M3 bag, and StreamIoJit relies on that coupling.

Separately, JitStreamIoKernel::implement() (+ its local shouldDeferHeavyStreamIoEmitters / deferred-stub emitters) is dead: only implementForUserScriptLowering() is called from StreamIoJit / StreamIoRuntime.

Path Today Target
Thin user-script AOT isThinStandaloneAotMain → kernel unchanged
Context standalone init defer via bag's $standaloneInitPhase StreamIoJit checks isStandaloneInitPhase() explicitly
M3 inventory / bootstrap-aot-link shouldDeferHeavyStreamIoEmitters env flags M3 flags only (no init-phase)
Dead kernel implement() unused LLVM stub path delete

php-src reference

PHP implementation target

  • lib/JIT/Builtin/StreamIoJit.php — isStandaloneInitPhase() \|\| shouldDeferHeavy… before NestedJIT
  • lib/JIT/Builtin/StreamIoRuntime.php — shouldDeferHeavyStreamIoEmitters = M3 env flags only
  • ext/standard/JitStreamIoKernel.php — delete dead implement + stub emitters + local shouldDefer
  • Shrink/unit guards + Context comment cleanup

Repro

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

Done when

  • shouldDeferHeavyStreamIoEmitters no longer reads $standaloneInitPhase
  • StreamIoJit gates init-phase explicitly via isStandaloneInitPhase()
  • Dead JitStreamIoKernel::implement (+ stub helpers) deleted
  • Shrink tests + vm-driver probe green
  • PR cites lines removed

Refs #1492, #20553, #20571

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