Skip to content

php-in-php: StringChunkSplit hand-rolled NestedJIT → JitVmHelperLink::ensureBridge (Soundex #21362 shape) (#1492) #21399

Closed

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, NestedJitCompileScope audit)

Problem

lib/JIT/Builtin/StringChunkSplit.php still hand-rolls NestedJIT of ChunkSplitJitHelper (manual parseAndCompile + new JIT inside NestedJitCompileScope::run) and emits its own LLVM bridge instead of JitVmHelperLink::ensureBridge.

Peers StringSoundex / StringMetaphone (#21362 / #21342) already route through JitVmHelperLink so nested helper compile stays isolated (user-script env clear, HelperRuntimeCache).

php-src reference

PHP implementation target

  • lib/JIT/Builtin/StringChunkSplit.php — replace hand-rolled NestedJIT + bridge with JitVmHelperLink::ensureBridge
  • test/unit/ChunkSplitRuntimeShrinkTest.php — guard JitVmHelperLink::ensureBridge, no parseAndCompile / new JIT(

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit test/unit/ChunkSplitRuntimeShrinkTest.php
'

Done when

  • StringChunkSplit uses JitVmHelperLink::ensureBridge only (no hand parseAndCompile)
  • ChunkSplitRuntimeShrinkTest green
  • PR cites lines removed from StringChunkSplit.php

Refs #1492, #14626, #21362, #21342

Activity

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

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — starting this run (StringChunkSplit → JitVmHelperLink::ensureBridge).

  3. PurHur commented on Jul 20, 2026

    @PurHur
    OwnerAuthor

    Merged via #21401.

    Verification:

    • vendor/bin/phpunit test/unit/ChunkSplitRuntimeShrinkTest.php — OK (3 tests)
    • make bootstrap-selfhost-vm-driver-execute-probe — OK

    StringChunkSplit.php: −102 / +28 lines (hand-rolled NestedJIT + bridge removed).

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