Skip to content

php-in-php: JIT CloneWithReinitRuntime — shrink clone-with readonly reinit LLVM glue via CloneWithSupport PHP (#1492) #10002

Closed

Description

@PurHur

Category

php-in-php · compile-pipeline (VM/JIT/AOT must agree on clone-with semantics)

Problem

clone $obj with { … } readonly property reinitialization still routes through lib/JIT/Builtin/CloneWithReinitRuntime.php (~316 lines LLVM) declaring/trampolineing __phpc_clone_with_* symbols, even though VM SSOT lives in CloneWithSupport / CloneWithJitHelper.php.

Workers adding PHP 8.3+ clone-with features (#4513, #9995 keyword-array syntax) must touch LLVM glue instead of shared PHP helpers.

php-src reference (semantics only)

Repro (migration metric)

wc -l lib/JIT/Builtin/CloneWithReinitRuntime.php ext/standard/CloneWithJitHelper.php lib/VM/CloneWithSupport.php
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/compliance/cases/language/clone_with*.phpt 2>/dev/null | tail -5'

Today: LLVM module owns reinit bitmap + property walk; PHP helper exists but JIT still emits native calls into CloneWithReinitRuntime.

Scope

Path Work
lib/JIT/Builtin/CloneWithReinitRuntime.php delete/shrink — route JIT clone-with reinit through compiled CloneWithJitHelper calls only
ext/standard/CloneWithJitHelper.php SSOT for reinitable property bitmap (shared VM/JIT)
lib/VM/CloneWithSupport.php VM path unchanged; JIT must call same helpers
lib/JIT/Builtin/CloneWithReinitRuntime.php target: thin ABI trampolines or zero LLVM after migration

PR must note lines removed from CloneWithReinitRuntime.php (or C symbols deleted).

Done when

  • JIT/AOT clone-with readonly reinit uses PHP helper path; no duplicate calendar/property LLVM in CloneWithReinitRuntime.php
  • Existing clone-with compliance PHPTs green VM + JIT + AOT
  • CloneWithReinitRuntime.php reduced to thin trampolines (or deleted with calls inlined via helper)
  • ./script/ci-fast.sh --filter clone_with green

Related

Activity

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

    @PurHur
    OwnerAuthor

    claim: cursor-agent-lane-a — starting this run

  3. PurHur commented on Jun 19, 2026

    @PurHur
    OwnerAuthor

    Unclaiming: already implemented on master — CloneWithReinitRuntime routes through CloneWithJitHelper PHP; CloneWithReinitRuntimeShrinkTest + clone_with compliance green. Switching to #9972.

  4. PurHur commented on Jun 23, 2026

    @PurHur
    OwnerAuthor

    Closing as duplicate: CloneWithReinitRuntime already routes through CloneWithJitHelper PHP on master.

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 & DevExphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions