WIP: DOM AOT instance bridge — nested Variable::toObject + per-arity invoke (#17391)#17397
Open
PurHur wants to merge 1 commit into
Open
WIP: DOM AOT instance bridge — nested Variable::toObject + per-arity invoke (#17391)#17397PurHur wants to merge 1 commit into
PurHur wants to merge 1 commit into
Conversation
…-arity invoke (#17391) Wire nested JIT lowering for Variable::toObject() (required by VariableObject::entry in VmDomInstanceInvoke), fix VmDomJitFrame to use Superglobals active context for AOT, and switch DomInstanceMethodRuntime to per-arity bridges matching #17130 batch work. VM + MCJIT green; standalone AOT execute still aborts (helper TU ObjectEntry access). Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VariableToObjectnested JIT handler soVariableObject::entry()lowers inVmDomInstanceInvokehelper TUs (Stdlib/AOT: DOM instance methods segfault in user-script standalone binary (ext/dom, #16075) #17391).VmDomJitFrameto read VM context fromSuperglobals::getActiveContext()(AOT has no executing PHP frame).DomInstanceMethodRuntimeto per-arity bridges (__phpc_jit_dom_instance_method_{0..4}) instead of args-table unpack — aligns with Stdlib: ext/dom PHP 8.4 Living Standard — JIT/AOT compliance batch (DOMTokenList, insertAdjacent*, innerHTML) #17130 / WIP: DOM PHP 8.4 instance methods — JIT/AOT bridge (#17130) #17331 direction.php-src reference
N/A (compiler AOT); behavior target:
ext/dom/php_dom.cinstance handlers once binary runs.PHP implementation
lib/JIT/Call/VariableToObject.php,lib/JIT/NestedVmVariableMethodLlvm.phpext/dom/VmDomInstanceInvoke.php,ext/dom/VmDomJitFrame.phplib/JIT/Builtin/DomInstanceMethodRuntime.php,lib/JIT/Call/DomInstanceMethod.phpVerification
Blocker (not merge-ready)
Standalone AOT compile succeeds (incl. new
test/fixtures/aot/compile-only/dom_create_element.php), but runtime aborts when the firstDOMDocument::createElement()bridge runs.new DOMDocument()alone is fine under AOT.Next step: user-script AOT defer path with class-id dispatch (no
ObjectEntryPHP property reads in split-compilation helper TUs) or prelinked helper-runtime unit + ctor init (#16075) — same class as #17331.Progress on #17391 — not closing yet.
Made with Cursor