Category
language
Problem
#57 tracks VM try/catch/finally lowering; #2084 ✅ adds compliance PHPTs for phase 1. JIT still has no exception unwind model — phpc serve --jit and JIT compliance for caught exceptions remain blocked after VM lands.
#195 throw expressions need a catch target in JIT for 007-ThrowsWeb matrix parity (#2103). VM path for 007 is largely green; JIT column is the gap.
php-src reference
Zend/zend_compile.c — zend_compile_try(), catch/finally op array layout
Zend/zend_exceptions.c — zend_throw_exception_internal, unwind stack
Zend/zend_execute.c — ZEND_HANDLE_EXCEPTION, ZEND_FAST_RET, finally before catch
- LLVM analogue: landing pads /
invoke + personality (see docs/capabilities-syntax.md try row)
Repro (today)
<?php
try {
throw new Exception('boom');
} catch (Exception $e) {
echo $e->getMessage();
}
# VM — passes (#2084 compliance)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php'
# → boom
# JIT — gap (VM fallback or LogicException depending on build)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php repro.php'
# Compliance gate
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/compliance/JITTest.php --filter try_catch'
Done when JIT repro prints boom without requiring full-VM fallback for this script.
Finally slice:
<?php
try {
throw new Exception('x');
} finally {
echo 'fin';
}
Scope
Phase A — VM fallback bridge (fastest slice)
| Layer |
Files |
Notes |
| JIT |
lib/JIT.php |
TYPE_TRY / catch: documented VM bridge or requiresVmLowering |
| Registry |
lib/Lint/UnsupportedRegistry.php |
Narrow try/catch kinds when bridge exists |
| Caps |
script/capability-syntax.php |
JIT row: partial until phase B |
Phase B — LLVM landing pads (full parity)
| Layer |
Files |
Notes |
| Compiler |
lib/Compiler.php |
Exception edges for JIT EH tables |
| JIT |
lib/JIT.php, lib/JIT/TryCatchHelper.php |
Landing pads / invoke-unwind (LLVM 9) |
| AOT |
lib/AOT/ |
Share EH metadata (#2101) |
| Tests |
test/compliance/cases/php/basic/try_catch_*.phpt |
Shared with #2084 |
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/compliance/JITTest.php --filter try_catch'
make test-harness ARGS='--filter try_catch'
./script/ci-fast.sh
Dependencies
Links
Category
languageProblem
#57 tracks VM try/catch/finally lowering; #2084 ✅ adds compliance PHPTs for phase 1. JIT still has no exception unwind model —
phpc serve --jitand JIT compliance for caught exceptions remain blocked after VM lands.#195 throw expressions need a catch target in JIT for 007-ThrowsWeb matrix parity (#2103). VM path for 007 is largely green; JIT column is the gap.
php-src reference
Zend/zend_compile.c—zend_compile_try(), catch/finally op array layoutZend/zend_exceptions.c—zend_throw_exception_internal, unwind stackZend/zend_execute.c—ZEND_HANDLE_EXCEPTION,ZEND_FAST_RET, finally before catchinvoke+ personality (seedocs/capabilities-syntax.mdtry row)Repro (today)
Done when JIT repro prints
boomwithout requiring full-VM fallback for this script.Finally slice:
Scope
Phase A — VM fallback bridge (fastest slice)
lib/JIT.phpTYPE_TRY/ catch: documented VM bridge orrequiresVmLoweringlib/Lint/UnsupportedRegistry.phpscript/capability-syntax.phpPhase B — LLVM landing pads (full parity)
lib/Compiler.phplib/JIT.php,lib/JIT/TryCatchHelper.phplib/AOT/test/compliance/cases/php/basic/try_catch_*.phptDone when
bin/jit.php repro.php) printsboomfor basic try/catchvendor/bin/phpunit test/compliance/JITTest.php --filter try_catchgreen onphp-compiler:22.04-devdocs/capabilities-syntax.mdtry row JIT = yes (or partial + bridge documented)./script/ci-local.shLLVM tail includes JIT try/catch when@group llvmrunsVerification
Dependencies
Links