Category
php-in-php · runtime
Problem
#9498 (closed) routed JIT embed clone-with readonly reinit through ext/standard/CloneWithJitHelper.php, but AOT standalone still emits CloneWithReinitRuntimeLlvm (~320 lines in lib/JIT/Builtin/CloneWithReinitRuntimeLlvm.php) with property-name string walks in LLVM.
Per PHP-in-PHP strategy: clone reinit semantics belong in ext/standard/CloneWithJitHelper.php + lib/VM/CloneWithSupport.php; AOT should link compiled PHP helpers, not grow lib/AOT/runtime/*.c.
php-src reference
Repro (audit today)
wc -l lib/JIT/Builtin/CloneWithReinitRuntimeLlvm.php
rg 'CloneWithReinitRuntimeLlvm' lib/AOT bin/compile.php
Build AOT binary with readonly + clone and confirm LLVM object still references __phpc_clone_with_* symbols from CloneWithReinitRuntimeLlvm instead of CloneWithJitHelper trampolines only.
Minimal runtime script:
<?php
class C {
public function __construct(public readonly string $v) {}
}
$c1 = new C('a');
$c2 = clone $c1;
echo $c2->v, "\n";
./script/docker-exec.sh php bin/vm.php repro.php # VM baseline
# AOT: compile repro.php and run; compare behavior + symbol table
Scope
| Path |
Work |
lib/JIT/Builtin/CloneWithReinitRuntime.php |
AOT standalone: always prefer compiled CloneWithJitHelper |
lib/JIT/Builtin/CloneWithReinitRuntimeLlvm.php |
Delete or thin to ABI trampolines only |
ext/standard/CloneWithJitHelper.php |
SSOT for reinit walk |
bin/compile.php / AOT link |
Ensure helper prelink like other php-in-php migrations |
Done when
Related
Category
php-in-php·runtimeProblem
#9498 (closed) routed JIT embed clone-with readonly reinit through
ext/standard/CloneWithJitHelper.php, but AOT standalone still emitsCloneWithReinitRuntimeLlvm(~320 lines inlib/JIT/Builtin/CloneWithReinitRuntimeLlvm.php) with property-name string walks in LLVM.Per PHP-in-PHP strategy: clone reinit semantics belong in
ext/standard/CloneWithJitHelper.php+lib/VM/CloneWithSupport.php; AOT should link compiled PHP helpers, not growlib/AOT/runtime/*.c.php-src reference
Zend/zend_objects.c—IS_PROP_REINITABLEduringcloneZend/zend_clone.cRepro (audit today)
wc -l lib/JIT/Builtin/CloneWithReinitRuntimeLlvm.php rg 'CloneWithReinitRuntimeLlvm' lib/AOT bin/compile.phpBuild AOT binary with
readonly+cloneand confirm LLVM object still references__phpc_clone_with_*symbols fromCloneWithReinitRuntimeLlvminstead ofCloneWithJitHelpertrampolines only.Minimal runtime script:
Scope
lib/JIT/Builtin/CloneWithReinitRuntime.phpCloneWithJitHelperlib/JIT/Builtin/CloneWithReinitRuntimeLlvm.phpext/standard/CloneWithJitHelper.phpbin/compile.php/ AOT linkDone when
wc -l lib/JIT/Builtin/CloneWithReinitRuntimeLlvm.phpnet decrease documented in PRa;make north-star5-verify-fastgreen if link path touchedRelated
lib/VM/CloneWithSupport.php· Epic Epic: Self-host critical path — compiler compiles itself (M3→M5) #1492