We want to be able to specialize iteration over generators and awaiting coroutines. Both for PEP 659 and for higher tier optimizers.
For the theory see faster-cpython/ideas#457
To do this we need:
Edited:
Remove the requirement for a GEN_RETURN_VALUE instruction. We might want one to simplify frame popping, but it isn't needed for specializing.
We want to be able to specialize iteration over generators and awaiting coroutines. Both for PEP 659 and for higher tier optimizers.
For the theory see faster-cpython/ideas#457
To do this we need:
FOR_ITERto leave iterator and value on the stack when exiting GH-96793: ChangeFOR_ITERto not pop the iterator on exhaustion. #96801FOR_ITERfor generators GH-96793: Specialize FOR_ITER for generators. #98772SENDfor coroutinesEdited:
Remove the requirement for a
GEN_RETURN_VALUEinstruction. We might want one to simplify frame popping, but it isn't needed for specializing.