Skip to content

php-in-php: route ArrayAccess JIT through VmArrayAccess PHP SSOT (#10246) - #11610

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-10246-array-access-php
Jun 25, 2026
Merged

php-in-php: route ArrayAccess JIT through VmArrayAccess PHP SSOT (#10246)#11610
PurHur merged 1 commit into
masterfrom
agent/issue-10246-array-access-php

Conversation

@PurHur

@PurHur PurHur commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move ArrayAccess $obj[$key] JIT lowering from lib/JIT/ArrayAccessHelper.php (~301 LOC) into lib/VM/VmArrayAccess.php (FromCallableHelper / VmFromCallable pattern).
  • ArrayAccessHelper is now a ~76-line thin trampoline; VM ArrayAccessDimension remains runtime SSOT.
  • php-src ref: Zend/zend_execute.c read_dimension / write_dimension, Zend/zend_interfaces.c offsetGet/Set.

Closes #10246

LLVM / JIT shrink

File Before After
lib/JIT/ArrayAccessHelper.php 301 76 (trampoline)
lib/VM/VmArrayAccess.php 308 (PHP SSOT)

Verification

./vendor/bin/phpunit --filter ArrayAccessHelperRuntimeShrinkTest
# OK (2 tests, 6 assertions)

./vendor/bin/phpunit --filter 'ArrayAccessJITTest|ForeachIteratorPolymorphicJitTest'
# OK (3 tests, 1 skipped — LLVM lint)

php script/check-selfhost-spine-coverage-sync.php
# check-selfhost-spine-coverage-sync: OK

Made with Cursor

)

Move ~225 lines of ArrayAccess offset LLVM lowering from lib/JIT/ArrayAccessHelper.php
into lib/VM/VmArrayAccess.php (FromCallableHelper pattern). JIT helper is now a thin
trampoline; VM ArrayAccessDimension remains runtime SSOT.

Verification: OK (2 tests) ArrayAccessHelperRuntimeShrinkTest
  OK (3 tests, 1 skipped) ArrayAccessJITTest + ForeachIteratorPolymorphicJitTest filter
  check-selfhost-spine-coverage-sync: OK
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.

php-in-php: JIT ArrayAccessHelper — route ArrayAccess $obj[$k] LLVM through VmArrayAccess PHP not ~301-line monolith (#1492)

1 participant