Skip to content

php-in-php: StringStrcoll NestedJIT → JitVmHelperLink::ensureCompiled (#1492) #22256

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer #22231 CopyRuntime / #22187 SysGetTempDirRuntime)

Problem

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

php-src reference

PHP implementation target

  • lib/JIT/Builtin/StringStrcoll.php — replace ensureJitHelperCompiled body with JitVmHelperLink::ensureCompiled; drop unused use NestedJitCompileScope / use JIT
  • test/unit/StrcollRuntimeShrinkTest.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/StrcollRuntimeShrinkTest.php'
make bootstrap-selfhost-vm-driver-execute-probe

Done when

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

Refs #1492, #13566, #22231, #22187

Activity

  1. added
    enhancementNew feature or request
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 22, 2026
  2. PurHur commented on Jul 22, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — starting this run

    Gate snapshot (before claim):

    Gate Status
    make bootstrap-selfhost-link green (/compiler/build/selfhost)
    php script/bootstrap-inventory.php --check OK 6392/6392
    ./script/release-readiness.sh --json user_release_ready: **yes**
    make bootstrap-selfhost-helloworld green (Hello World)

    Migrating StringStrcoll NestedJIT hand-roll → JitVmHelperLink::ensureCompiled (peer #22231 / #22187).

  3. PurHur commented on Jul 22, 2026

    @PurHur
    OwnerAuthor

    Merged via #22257

    Verification

    • vendor/bin/phpunit test/unit/StrcollRuntimeShrinkTest.php → OK (6 tests, 18 assertions)
    • make bootstrap-selfhost-vm-driver-execute-probe → OK
    • Net shrink: hand-rolled NestedJIT block (−21 lines) → JitVmHelperLink::ensureCompiled; StringStrcoll.php 157 → 137 lines
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