Category
php-in-php · php-src-strict runtime semantics via PHP SSOT
Problem
assert_options() JIT lowering lives in lib/JIT/Builtin/AssertOptionsRuntime.php (~476 LLVM lines) plus AssertIniRuntime.php globals (~88 lines). The VM already has PHP handlers in ext/standard/ (see assert_options.php, assert.php, issue #3316).
JIT/AOT should call the same PHP implementation through a thin JIT helper bridge (pattern: LastErrorRuntime → VmErrorLast, IniRuntime → VmIni), not duplicate assert INI state in LLVM globals.
php-src reference
Repro (parity baseline — VM must stay green)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "
var_dump(assert_options(ASSERT_ACTIVE));
assert_options(ASSERT_ACTIVE, 1);
var_dump(assert_options(ASSERT_ACTIVE));
"'
JIT gap today: compiling assert_options() in a JIT unit uses LLVM AssertOptionsRuntime instead of PHP.
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/jit.php -r "var_dump(assert_options(ASSERT_ACTIVE));"'
Scope (this repo)
| Path |
Work |
ext/standard/VmAssert.php (or extend existing assert VM class) |
SSOT for assert_options get/set |
lib/JIT/Builtin/AssertOptionsRuntime.php |
Replace LLVM bodies with JitHelper call into PHP |
lib/JIT/Builtin/AssertIniRuntime.php |
Delete or shrink to thin ABI; INI state owned by PHP |
lib/JIT/BuiltinRegistry.php |
Wire helper registration |
| Tests |
JIT PHPT for assert_options round-trip |
Done when
Related
Category
php-in-php· php-src-strict runtime semantics via PHP SSOTProblem
assert_options()JIT lowering lives inlib/JIT/Builtin/AssertOptionsRuntime.php(~476 LLVM lines) plusAssertIniRuntime.phpglobals (~88 lines). The VM already has PHP handlers inext/standard/(seeassert_options.php,assert.php, issue #3316).JIT/AOT should call the same PHP implementation through a thin JIT helper bridge (pattern:
LastErrorRuntime→VmErrorLast,IniRuntime→VmIni), not duplicate assert INI state in LLVM globals.php-src reference
ext/standard/assert.c—PHP_FUNCTION(assert_options),zend_assertionsINIZend/zend_API.c— assertion callback storageRepro (parity baseline — VM must stay green)
JIT gap today: compiling
assert_options()in a JIT unit uses LLVMAssertOptionsRuntimeinstead of PHP.Scope (this repo)
ext/standard/VmAssert.php(or extend existing assert VM class)lib/JIT/Builtin/AssertOptionsRuntime.phpJitHelpercall into PHPlib/JIT/Builtin/AssertIniRuntime.phplib/JIT/BuiltinRegistry.phpassert_optionsround-tripDone when
assert_options()delegates to PHP SSOT — delete or substantially shrinkAssertOptionsRuntimeLLVM (target: thin trampoline only)assert_options(ASSERT_CALLBACK, $fn)callback identity preserved across JIT callsAssertOptionsRuntime.php/AssertIniRuntime.phpruntime/*.cRelated