Category
php-in-php · JIT lowering migration
Problem
lib/JIT/ReflectionBuiltinHelper.php (~336 lines) duplicates compile-time class literal checks and runtime reflection plumbing in LLVM:
VM path: ext/standard/VmReflection.php already implements reflection in PHP. JIT LLVM re-implements subsets → drift vs VM (readonly #5221, asymmetric #5060, enum cases #9537).
php-src reference
Repro (JIT vs VM drift)
Save as test/repro/maintainer_reflection_class_is_readonly.php (from #5221):
<?php
readonly class R {}
$rr = new ReflectionClass(R::class);
echo method_exists($rr, 'isReadOnly') ? 'method:yes' : 'method:no', "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_reflection_class_is_readonly.php 2>&1 | head -4
php bin/jit.php test/repro/maintainer_reflection_class_is_readonly.php 2>&1 | head -4
'
After migration, JIT must call same VmReflection entrypoints — fixing #5221 once applies to both.
Scope (PHP-in-PHP)
| Layer |
Path |
| VM SSOT |
ext/standard/VmReflection.php — keep expanding real semantics |
| JIT |
lib/JIT/ReflectionBuiltinHelper.php → thin calls into JitReflection* wrappers over VM |
| Builtin |
lib/JIT/ReflectionBuiltinHelper.php delete inline LLVM after parity |
| Tests |
Existing reflection compliance PHPTs must pass JIT |
No new C runtime logic.
Done when
Related
#5221 · #4384 · #5060 · #1492
Category
php-in-php· JIT lowering migrationProblem
lib/JIT/ReflectionBuiltinHelper.php(~336 lines) duplicates compile-time class literal checks and runtime reflection plumbing in LLVM:class_exists/interface_existsliteral fast pathsReflectionClass/ReflectionMethod/ReflectionPropertyconstruction guards (Stdlib: class_exists() — VM + LLVM JIT/AOT #1214–Stdlib: is_subclass_of() — VM + LLVM JIT/AOT #1219)VM path:
ext/standard/VmReflection.phpalready implements reflection in PHP. JIT LLVM re-implements subsets → drift vs VM (readonly #5221, asymmetric #5060, enum cases #9537).php-src reference
ext/reflection/php_reflection.c— reflection object constructionZend/zend_compile.c— class table metadata consumed by reflectionRepro (JIT vs VM drift)
Save as
test/repro/maintainer_reflection_class_is_readonly.php(from #5221):After migration, JIT must call same
VmReflectionentrypoints — fixing #5221 once applies to both.Scope (PHP-in-PHP)
ext/standard/VmReflection.php— keep expanding real semanticslib/JIT/ReflectionBuiltinHelper.php→ thin calls intoJitReflection*wrappers over VMlib/JIT/ReflectionBuiltinHelper.phpdelete inline LLVM after parityNo new C runtime logic.
Done when
ReflectionBuiltinHelperreduced to trampoline / declare-only LLVM./script/ci-fast.sh --filter ReflectionBuiltingreenRelated
#5221 · #4384 · #5060 · #1492