Skip to content

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

Merged
PurHur merged 3 commits into
masterfrom
agent/issue-10080-iterator-helper-php
Jul 11, 2026
Merged

PurHur merged 3 commits into
masterfrom
agent/issue-10080-iterator-helper-php

Conversation

@PurHur

@PurHur PurHur commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Shrinks lib/JIT/IteratorHelper.php from ~725 lines of inline LLVM to a 54-line trampoline delegating to lib/VM/VmIteratorForeach.php (744 lines, PHP SSOT for hashtable/SplObjectStorage/WeakMap foreach lowering).
  • Adds spine require for VmIteratorForeach.php and shrink guard IteratorHelperRuntimeShrinkTest.
  • Rebased onto current master; regenerated docs/bootstrap-inventory.md.

C runtime: no new C — net ~671 LLVM lines removed from IteratorHelper (moved to compiled PHP helper path via existing JitVmHelperLink bridge inside VmIteratorForeach).

Closes #10080

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter IteratorHelperRuntimeShrinkTest'
# OK (2 tests, 10 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/foreach_jit_vm_agree.php
php bin/jit.php test/repro/foreach_jit_vm_agree.php
'
# k=v / sum=3 on VM and JIT

php script/check-selfhost-spine-coverage-sync.php
# OK (spine covers all 4482 inventory files)

php script/bootstrap-inventory.php --check
# OK 4482/4482

make north-star5-verify-fast
# north-star5-verify: OK (fast)

Made with Cursor

PurHur and others added 3 commits June 25, 2026 13:51
…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>
Resolve bootstrap-inventory.md conflict (regenerate after merge).

Co-authored-by: Cursor <cursoragent@cursor.com>
)

Regenerate bootstrap-inventory.md post-merge; add issue repro script.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 47b9b50 into master Jul 11, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-10080-iterator-helper-php branch July 11, 2026 14:44
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