Skip to content

php-in-php: drop shouldDeferHeavyStreamIoEmitters from ObOutputJitBridge — thin via isThinStandaloneAotMain (#1492) #20443

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer PendingHeaders #20420 / CliArgv #20401 / StringFormat #20395)

Problem

ObOutputJitBridge::implementObStack still gates deferred inventory ABI stubs on StreamIoRuntime::shouldDeferHeavyStreamIoEmitters() (inventory-emit + NestedJit defer bag). Peer PendingHeadersJitBridge (#20420) already uses Context::isThinStandaloneAotMain() for the same thin-standalone constraint (#16075 / #13571). Under M3 inventory emit / standaloneInitPhase the StreamIo defer bag forces stub __phpc_ob_* bodies instead of honest ObOutputJitHelper NestedJIT when not thin-standalone.

Thin user-script AOT already routes through JitObOutputKernel via ObOutputRuntime::ensureObStackLinked — this change only widens when the bridge emits honest NestedJIT helpers vs inventory stubs.

Mode Today Target
Embed / non-thin ObOutputJitHelper NestedJIT bridges unchanged
User-script / bootstrap thin AOT shouldDeferHeavyStreamIoEmittersimplementDeferredInventoryStubs isThinStandaloneAotMain() → same thin stubs (kernel path elsewhere)
Inventory emit / M3 driver / standaloneInitPhase deferred via StreamIo defer bag (stubs) honest NestedJIT helper bridges when not thin

php-src reference

PHP implementation target

  • lib/JIT/Builtin/ObOutputJitBridge.php — gate implementDeferredInventoryStubs on $context->isThinStandaloneAotMain(); drop shouldDeferHeavyStreamIoEmitters
  • test/unit/ObOutputRuntimeShrinkTest.php — assert isThinStandaloneAotMain on bridge, no shouldDeferHeavyStreamIoEmitters

Repro

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

Done when

  • shouldDeferHeavyStreamIoEmitters removed from ObOutputJitBridge
  • Thin path gated on isThinStandaloneAotMain only (stubs retained)
  • Shrink test green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites defer-gate lines removed

Refs #1492, #9268, #12951, #19422, #20420, #20401, #20395

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