Skip to content

php-in-php: Bz2StreamRuntime NestedJIT → JitVmHelperLink::ensureCompiled (#1492) #22416

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer #22399 SysGetloadavgRuntime / #22370 GethostbyaddrRuntime)

Problem

lib/JIT/Builtin/Bz2StreamRuntime.php still hand-rolls NestedJitCompileScope::run + parseAndCompile + new JIT() for Bz2StreamJitHelper.php. Peer runtimes route helper compile through JitVmHelperLink::ensureCompiled for consistent user-script env clearing, insert-block restore, and helper-runtime cache.

Keep NestedJitCompileScope::isActive() early-return in implement() (skip bridge emission during nested helper compile) — only delete the hand-rolled compile body.

php-src reference

PHP implementation target

  • lib/JIT/Builtin/Bz2StreamRuntime.php — replace ensureJitHelperCompiled body with JitVmHelperLink::ensureCompiled; use lookupCompiled; drop unused use PHPCompiler\JIT
  • test/unit/Bz2StreamRuntimeShrinkTest.php — guard JitVmHelperLink::ensureCompiled, no hand-rolled NestedJitCompileScope::run / parseAndCompile / new JIT(

Repro

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

Done when

  • Bz2StreamRuntime uses JitVmHelperLink::ensureCompiled only for helper compile
  • Shrink unit test green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites lines removed

Refs #1492, #17301, #22399, #22370

No activity

Activity on this issue will appear here.

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