Skip to content

php-in-php: FtokRuntime NestedJIT → JitVmHelperLink::ensureCompiled (#1492) #22300

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer #22256 StringStrcoll / #22276 LdapRuntime)

Problem

lib/JIT/Builtin/FtokRuntime.php still hand-rolls NestedJitCompileScope::run + parseAndCompile + new JIT() for FtokJitHelper.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/FtokRuntime.php — replace ensureJitHelperCompiled body with JitVmHelperLink::ensureCompiled; drop unused use NestedJitCompileScope / use JIT
  • test/unit/FtokRuntimeShrinkTest.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/FtokRuntimeShrinkTest.php'
make bootstrap-selfhost-vm-driver-execute-probe

Done when

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

Refs #1492, #9585, #22256, #22276

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

    Migrating FtokRuntime NestedJIT hand-roll to JitVmHelperLink::ensureCompiled (peer StringStrcoll #22256 / LdapRuntime #22276).

    Pre-claim gate snapshot (master @ 7574cb3)

    Gate Status
    make bootstrap-selfhost-link OK
    php script/bootstrap-inventory.php --check OK 6412/6412
    prior release-readiness --json user_release_ready: yes (north-star5-fast + vm-driver-probe ok)
  3. PurHur commented on Jul 22, 2026

    @PurHur
    OwnerAuthor

    Merged via #22301.

    Verification

    Command Result
    vendor/bin/phpunit test/unit/FtokRuntimeShrinkTest.php OK (5 tests, 19 assertions)
    vendor/bin/phpunit --filter ftok OK (10 tests)
    make bootstrap-selfhost-vm-driver-execute-probe OK
    make north-star5-verify-fast OK (fast)
    php script/bootstrap-inventory.php --check OK 6412/6412
    php script/check-bootstrap-gen0-manifest-sync.php OK

    NestedJIT shrink

    • lib/JIT/Builtin/FtokRuntime.php: 185 → 158 lines — deleted hand-rolled NestedJitCompileScope::run + parseAndCompile + new JIT(); now JitVmHelperLink::ensureCompiled
    • Inventory warnings for FtokRuntime: 3 → 1
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