WIP: DOM PHP 8.4 instance methods — JIT/AOT bridge (#17130)#17331
WIP: DOM PHP 8.4 instance methods — JIT/AOT bridge (#17130)#17331PurHur wants to merge 1 commit into
Conversation
…17130) Wire ext/dom instance calls through per-arity VmDomInstanceInvoke helpers, helper-runtime discovery (COMPILED_HELPERS), and Superglobals-based frame lookup. Add Variable::toObject nested JIT handler. VM and JIT repros pass; AOT compile succeeds but runtime still aborts in nested helper TU (follow-up: ObjectEntry/class_id dispatch without PHP ObjectEntry property reads). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Maintainer triage 2026-07-08: bootstrap link+helloworld green. AOT runtime abort noted — not merging until execute path green. Keep WIP. |
Advanced stdlib triage (2026-07-08)Re-verified blocker on current branch HEAD ( source script/php-env.sh
php bin/vm.php test/repro/aot_dom_loadhtml_probe.php # div_ok
php bin/jit.php test/repro/aot_dom_loadhtml_probe.php # div_ok
php bin/compile.php -o /tmp/dom_probe test/repro/aot_dom_loadhtml_probe.php # compile OK
/tmp/dom_probe # Aborted (exit 134)Same class of failure on master for already-merged DOM JIT paths: php bin/compile.php -o /tmp/dom_create test/repro/maintainer_gap_dom_create_element_aot.php
/tmp/dom_create # phpc: fatal signal (segfault) after c:main_before_php — exit 139Disabling helper-runtime cache ( Root cause (unchanged): user-script standalone AOT cannot run nested Next step: PR remains WIP — not merge-ready. |
Summary
DomInstanceMethodRuntime→VmDomInstanceInvoke→VmDomJitDispatch) forloadHTML,getElementById, and existing token-list/create/append paths (Stdlib: ext/dom PHP 8.4 Living Standard — JIT/AOT compliance batch (DOMTokenList, insertAdjacent*, innerHTML) #17130).ext/dom/VmDomInstanceInvoke.phpviaCOMPILED_HELPERS(helper-runtime emit/prelink path).VmDomJitFrameto useSuperglobals::getActiveContext()(AOT has no executing PHP frame).Variable::toObject()(VariableToObject+NestedVmVariableMethodLlvm).php-src reference
ext/dom/php_dom.c—DOMDocument::loadHTML,DOMDocument::getElementByIdPHP implementation
ext/dom/VmDomInstanceInvoke.php,VmDomJitDispatch.php,VmDomJitFrame.phplib/JIT/Builtin/DomInstanceMethodRuntime.php,lib/JIT/Call/DomInstanceMethod.php,lib/JIT/DomInstanceMethodJit.phpVerification (2026-07-07)
Blocker (not merge-ready)
AOT compile succeeds and links DOM bridge LLVM, but runtime aborts when the first DOM instance method runs. Root cause is incomplete nested-helper corpus: after
Variable::resolveIndirect()/toObject(), dispatch still needsObjectEntry/ClassEntryproperty access that is not lowered for split-compilation helper objects (same class of failure asmethod_exists($object)under AOT — baseline repro also aborts).Next step: class-id-based dispatch bridge (read
__object__.class_idin LLVM, call VM lookup without PHPObjectEntryproperty reads) or complete #16075 extern binding for helper TUs; then refreshprelinked/helper-runtime/.../ext_dom_VmDomInstanceInvoke_php/.Progress on #17130 — not closing yet.
Made with Cursor