Skip to content

php-in-php: route TYPE_FROM_CALLABLE JIT through VmFromCallable PHP (#10272) - #10454

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-from-callable-10272
Jun 21, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-from-callable-10272

Conversation

@PurHur

@PurHur PurHur commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move TYPE_FROM_CALLABLE (first-class callable) JIT lowering SSOT from lib/JIT/FromCallableHelper.php (~214 lines) into lib/VM/VmFromCallable.php, aligned with ClosureSupport::fromCallable() semantics (Zend zend_closures.c / zend_compile.c).
  • Shrink FromCallableHelper to a 22-line trampoline delegating to VmFromCallable.
  • Add FromCallableRuntimeShrinkTest + spine/bundle entries for self-host.

Lines removed from JIT helper: 214 → 22 (−192 lines, ~90% shrink). Logic now lives in lib/VM/VmFromCallable.php (PHP SSOT).

Closes #10272

Verification

vendor/bin/phpunit test/unit/FromCallableRuntimeShrinkTest.php
# OK (2 tests, 10 assertions)

vendor/bin/phpunit test/unit/JitFirstClassCallableTest.php --filter testCompilerLowersFirstClassCallableToFromCallableOpcode
# OK (1 test, 1 assertion)

php bin/vm.php /tmp/fcc_repro.php
# 3
# 1

make bootstrap-selfhost-vm-driver-execute-probe
# bootstrap-selfhost-vm-driver-execute-probe: OK

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

Made with Cursor

…10272)

Move FCC lowering SSOT from FromCallableHelper (~214 lines) into lib/VM/VmFromCallable.php
aligned with ClosureSupport; shrink JIT helper to a thin trampoline.

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 FromCallableHelper — route TYPE_FROM_CALLABLE LLVM through VmClosure PHP not ~214-line helper (#1492)

1 participant