Category
php-in-php · language · compile/JIT
Problem
(array) / (object) / (unset) casts have VM semantics in lib/VM/CastSupport.php and ext/standard/JitGetObjectVars.php, but JIT still lowers through lib/JIT/CastHelper.php (~125 LOC) with inline LLVM branches (HashTableHelper, CastArrayRuntime, JitGetObjectVars).
This duplicates enum/object/array cast rules already tracked in parity issues (#9659, #9950, #10046) and blocks shrinking JIT monoliths per #1492.
php-src reference
Repro (architect baseline)
wc -l lib/JIT/CastHelper.php lib/VM/CastSupport.php
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/jit.php -r "var_export((array) new stdClass());" 2>&1
php bin/jit.php -r "var_export((object) [\"a\"=>1]);" 2>&1
'
Today JIT path uses CastHelper LLVM; VM -r works via interpreter.
Scope (this repo)
| Path |
Work |
lib/JIT/CastHelper.php |
Replace body with trampoline to VmCast / CastJitHelper PHP entry |
lib/VM/CastJitHelper.php |
Shared SSOT callable from JIT (mirror VmCoalesce pattern #10171) |
lib/JIT/Builtin/CastArrayRuntime.php |
Delete or thin after PHP path owns behavior |
PHP-in-PHP first — delete LLVM cast branches when VM PHP path is hot enough; no new runtime/*.c.
Done when
Related
Category
php-in-php·language· compile/JITProblem
(array)/(object)/(unset)casts have VM semantics inlib/VM/CastSupport.phpandext/standard/JitGetObjectVars.php, but JIT still lowers throughlib/JIT/CastHelper.php(~125 LOC) with inline LLVM branches (HashTableHelper,CastArrayRuntime,JitGetObjectVars).This duplicates enum/object/array cast rules already tracked in parity issues (#9659, #9950, #10046) and blocks shrinking JIT monoliths per #1492.
php-src reference
Zend/zend_operators.c—convert_to_array,convert_to_objectext/standard/type.c—settype/ cast helpersRepro (architect baseline)
Today JIT path uses CastHelper LLVM; VM
-rworks via interpreter.Scope (this repo)
lib/JIT/CastHelper.phpVmCast/CastJitHelperPHP entrylib/VM/CastJitHelper.phpVmCoalescepattern #10171)lib/JIT/Builtin/CastArrayRuntime.phpPHP-in-PHP first — delete LLVM cast branches when VM PHP path is hot enough; no new
runtime/*.c.Done when
CastHelper.php≤ ~40 LOC glue (or deleted)(array)/(object)on stdClass, array, enum cases match VM/php-src (Language: (array) cast on backed enum case — must yield name/value array not backing list (Zend/zend_enum.c) #9659, Regression: (object) cast on enum case returns empty stdClass not enum identity (re-#9569, Zend/zend_operators.c) #9950 repros green underbin/jit.php)lib/JIT/CastHelper.php+ any orphanedCastArrayRuntimeLLVM noted in PR./script/ci-fast.sh --filter Castgreen (add JIT cast smoke if missing)Related