Skip to content

WIP: DOM AOT instance bridge — nested Variable::toObject + per-arity invoke (#17391)#17397

Open
PurHur wants to merge 1 commit into
masterfrom
agent/issue-17391-dom-aot-toobject
Open

WIP: DOM AOT instance bridge — nested Variable::toObject + per-arity invoke (#17391)#17397
PurHur wants to merge 1 commit into
masterfrom
agent/issue-17391-dom-aot-toobject

Conversation

@PurHur

@PurHur PurHur commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

N/A (compiler AOT); behavior target: ext/dom/php_dom.c instance handlers once binary runs.

PHP implementation

  • lib/JIT/Call/VariableToObject.php, lib/JIT/NestedVmVariableMethodLlvm.php
  • ext/dom/VmDomInstanceInvoke.php, ext/dom/VmDomJitFrame.php
  • lib/JIT/Builtin/DomInstanceMethodRuntime.php, lib/JIT/Call/DomInstanceMethod.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_gap_dom_create_element_aot.php'
# p

php bin/jit.php test/repro/maintainer_gap_dom_create_element_aot.php
# p

php bin/compile.php -o /tmp/dom_create test/repro/maintainer_gap_dom_create_element_aot.php
# compile exit 0

/tmp/dom_create; echo exit=$?
# exit=134 (Aborted) — execute tier still red; was exit=139 segfault before this branch

vendor/bin/phpunit test/unit/NestedVmVariableToObjectTest.php test/unit/DomInstanceMethodJitTest.php --no-configuration
# OK

./script/ci-fast.sh
# exit 0

Blocker (not merge-ready)

Standalone AOT compile succeeds (incl. new test/fixtures/aot/compile-only/dom_create_element.php), but runtime aborts when the first DOMDocument::createElement() bridge runs. new DOMDocument() alone is fine under AOT.

Next step: user-script AOT defer path with class-id dispatch (no ObjectEntry PHP 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

…-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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant