Skip to content

php-in-php: route StringQuotemeta through JitVmHelperLink::ensureBridge (#1492) #21589

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer #21362 / #21399 / #21579)

Problem

lib/JIT/Builtin/StringQuotemeta.php still hand-rolls NestedJitCompileScope::run + new JIT($context)->compile (~150 LOC bridge boilerplate) instead of the shared JitVmHelperLink::ensureBridge path used by StringSoundex (#21362) and StringChunkSplit (#21399). Same NestedJIT QuotemetaJitHelper SSOT — only the link glue is duplicated.

php-src reference

PHP implementation target

  • lib/JIT/Builtin/StringQuotemeta.php — replace hand-rolled NestedJIT loop with JitVmHelperLink::ensureBridge (Soundex/ChunkSplit shape)
  • test/unit/QuotemetaRuntimeShrinkTest.php — assert ensureBridge, no parseAndCompile / new JIT(
  • Net shrink: delete ~80 LOC of duplicated NestedJIT glue

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit --filter QuotemetaRuntimeShrinkTest
vendor/bin/phpunit --filter quotemeta
'

Done when

  • StringQuotemeta uses JitVmHelperLink::ensureBridge only
  • No hand-rolled NestedJitCompileScope::run / new JIT( in StringQuotemeta
  • Shrink + quotemeta AOT/compliance green
  • make bootstrap-selfhost-vm-driver-execute-probe green
  • PR body cites lines removed

Refs #1492, #21362, #21399

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

    Pillar 1: inventory was RED (hash_hmac construct flags); regenerated → OK 6201/6201. release-readiness still running. Implementing StringQuotemeta → JitVmHelperLink::ensureBridge (Soundex #21362 peer).

  3. PurHur commented on Jul 20, 2026

    @PurHur
    OwnerAuthor

    Merged via #21590 (squash).

    Verification: QuotemetaRuntimeShrinkTest OK · quotemeta compliance (7) OK · make bootstrap-selfhost-vm-driver-execute-probe OK. Net −103 LOC; hand-rolled NestedJIT glue deleted.

    Note: standalone AOT quotemeta/soundex segfault after c:main_before_php is pre-existing on master (same host); not a regression from this PR.

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