Category
php-in-php · compile/runtime bridge
Problem
lib/JIT/Builtin/ExceptionThrowRuntime.php (~349 lines) implements throw/unwind setup in LLVM (exception object globals, bridge to ExceptionJitHelper). VM throw semantics live in lib/VM.php + VmException paths; JIT duplicates unwind tables instead of reusing compiled PHP helpers.
Sibling #9663 tracks ExceptionHandlerJitRuntime + try/catch; this issue is the throw expression / Object.throw fast path only.
php-src reference
Repro
<?php
try {
throw new RuntimeException('probe');
} catch (RuntimeException $e) {
echo $e->getMessage(), "\n";
}
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_throw_probe.php
php bin/jit.php test/repro/maintainer_throw_probe.php
'
VM prints probe; JIT must match without growing ExceptionThrowRuntime LLVM.
Scope (this repo)
| Piece |
Path |
| PHP SSOT |
lib/VM/VmException.php (or extract throw helper used by VM + JIT) |
| JIT |
ExceptionThrowRuntime::implement() → emit call into ExceptionThrowJitHelper compiled unit |
| Shrink |
delete LLVM throw object materialization from ExceptionThrowRuntime.php |
| Tests |
existing test/compliance/cases/language/throw_*.phpt, test/unit/JitExceptionTest.php |
No new runtime/*.c exception tables.
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter JitException'
Related
Category
php-in-php· compile/runtime bridgeProblem
lib/JIT/Builtin/ExceptionThrowRuntime.php(~349 lines) implements throw/unwind setup in LLVM (exception object globals, bridge toExceptionJitHelper). VM throw semantics live inlib/VM.php+VmExceptionpaths; JIT duplicates unwind tables instead of reusing compiled PHP helpers.Sibling #9663 tracks
ExceptionHandlerJitRuntime+ try/catch; this issue is thethrowexpression /Object.throwfast path only.php-src reference
Zend/zend_exceptions.c—zend_throw_exception_internal,zend_throw_errorZend/zend_vm_execute.h—ZEND_HANDLE_EXCEPTIONRepro
VM prints
probe; JIT must match without growingExceptionThrowRuntimeLLVM.Scope (this repo)
lib/VM/VmException.php(or extract throw helper used by VM + JIT)ExceptionThrowRuntime::implement()→ emit call intoExceptionThrowJitHelpercompiled unitExceptionThrowRuntime.phptest/compliance/cases/language/throw_*.phpt,test/unit/JitExceptionTest.phpNo new
runtime/*.cexception tables.Done when
ExceptionThrowRuntimeLLVMimplement()removed or ≤50-line trampoline./script/ci-fast.sh --filter throwgreen on JIT fixturesVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter JitException'Related