forked from ircmaxell/php-compiler
-
Notifications
You must be signed in to change notification settings - Fork 1
Language: Generator JIT lowering (yield opcodes) #3074
Copy link
Copy link
Closed
Labels
area:compilerCompiler / CFG / JITCompiler / CFG / JITenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language featuresPhase 2 – language features
Description
Activity
Metadata
Metadata
Assignees
Labels
area:compilerCompiler / CFG / JITCompiler / CFG / JITenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language featuresPhase 2 – language features
Category
language· php-src-strictProblem
Generators work on VM (
lib/VM/GeneratorState.php,TYPE_YIELD/TYPE_YIELD_FROM) but JIT aborts withLogicException: Generators (yield) are VM-only (issue #167)inlib/JIT.php(~5574).bin/jit.phpfalls back to VM; there is no LLVM lowering for suspend/resume.Blocks JIT-native compliance for generator-heavy code and self-host paths that compile
lib/with yield.php-src reference
Zend/zend_generators.c— generator object,zend_generator_resume(),send/throw/getReturnZend/zend_execute.c—ZEND_YIELD/ZEND_YIELD_FROMopcode handlersZend/zend_compile.c— generator function flagRepro (failure today)
1212bin/jit.php12without VM fallbackScope (this repo)
lib/JIT.phplib/JIT/Context.phplib/VM/GeneratorState.phptest/compliance/cases/language/generator_jit.phptPHP-in-PHP: LLVM lowering in
lib/JIT/; no newruntime/*.c.Done when
bin/jit.phprepro prints12without VM fallbackyield fromon arrays at minimum (full parity tracked in Language: generators (yield / yield from) — Generator object + send/throw/getReturn parity #4489)./script/ci-local.sh --filter generator_jitgreen (LLVM phase when JIT group enabled)docs/capabilities.mdJIT columnyesfor generators viascript/capability-matrix.phpVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./vendor/bin/phpunit --filter generator_jit test/compliance/JITTest.php'Strictness
php-src-strict for user-visible generator iteration; #4599 tracks foreach-by-ref phase 2.
Related