Skip to content

php-in-php: route IteratorHelper foreach LLVM through VmIteratorForeach PHP (#10080) - #11652

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-10080-iterator-helper-php
Jun 25, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-10080-iterator-helper-php

Conversation

@PurHur

@PurHur PurHur commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • Zend/zend_execute.c — ZEND_FE_FETCH_R array/hashtable branch

LLVM shrink

File Before After
lib/JIT/IteratorHelper.php 725 54
lib/VM/VmIteratorForeach.php — 744 (new SSOT)

No new runtime/*.c symbols.

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit --filter IteratorHelperRuntimeShrinkTest
php script/check-selfhost-spine-coverage-sync.php
make bootstrap-selfhost-vm-driver-execute-probe
php script/bootstrap-inventory.php --check
'
OK (2 tests, 10 assertions)
check-selfhost-spine-coverage-sync: OK (spine covers all 3148 inventory files)
bootstrap-selfhost-vm-driver-execute-probe: OK
bootstrap-inventory --check: OK (after regen)

Closes #10080

Made with Cursor

…ch PHP (#10080)

Move hashtable/SplObjectStorage/WeakMap foreach lowering from lib/JIT/
IteratorHelper.php (725 lines) into lib/VM/VmIteratorForeach.php SSOT;
IteratorHelper is now a thin trampoline (54 lines). Spine + shrink guard.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur force-pushed the agent/issue-10080-iterator-helper-php branch from 2bc2b3b to 008dd37 Compare June 25, 2026 13:51
@PurHur
PurHur merged commit 0b58a4e into master Jun 25, 2026
@PurHur
PurHur deleted the agent/issue-10080-iterator-helper-php branch June 25, 2026 13:52
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 IteratorHelper — route foreach iterator protocol through VmIterator PHP not ~725-line LLVM (#1492)

1 participant