Skip to content

Language: Fiber JIT/AOT resume lowering (#4019) - #4086

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-4019-fiber-jit-aot
Jun 1, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-4019-fiber-jit-aot

Conversation

@PurHur

@PurHur PurHur commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add FiberHelper MCJIT/AOT lowering for fiber callbacks with Fiber::suspend() resume points (php-src Zend/zend_fibers.c).
  • Register Fiber::__construct, start, resume JIT calls; fiber closures compile to {closure}_N__fiber_resume switch functions.
  • AOT native execute is green; bin/jit.php uses existing VM fallback via Block::requiresVmLowering() until MCJIT execute segfault is fixed (tracked in Language: Fiber JIT/AOT — native suspend/resume (phase 2 of #3130) #4019).

php-src reference

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro-maintainer/fiber_jit_repro.php'
# ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php test/repro-maintainer/fiber_jit_repro.php'
# ok (VM fallback — requiresVmLowering for Fiber::suspend in script)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/compile.php -o /tmp/fiber_aot test/repro-maintainer/fiber_jit_repro.php && /tmp/fiber_aot'
# ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter fiber_suspend test/aot/AotTest.php'
# OK (1 test)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter fiber_jit test/compliance/VMTest.php'
# OK (1 test)

Closes #4019

Made with Cursor

…4019)

Implement Fiber::suspend/start/resume via FiberHelper (switch-on-resume-ip
closures, php-src Zend/zend_fibers.c). AOT user scripts run green; bin/jit.php
uses VM fallback until MCJIT execute is stable (requiresVmLowering).

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.

Language: Fiber JIT/AOT — native suspend/resume (phase 2 of #3130)

1 participant