GH-145667: Merge GET_ITER and GET_YIELD_FROM_ITER (GH-146120)

* Merge GET_ITER and GET_YIELD_FROM_ITER. Modify SEND to make it a bit more like FOR_ITER
This commit is contained in:
Mark Shannon 2026-03-21 10:48:13 +00:00 committed by GitHub
parent b5e4c46be2
commit 879c85f6e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 944 additions and 989 deletions

View file

@ -2884,7 +2884,6 @@ optimize_load_fast(cfg_builder *g)
case GET_ANEXT:
case GET_ITER:
case GET_LEN:
case GET_YIELD_FROM_ITER:
case IMPORT_FROM:
case MATCH_KEYS:
case MATCH_MAPPING:
@ -2919,7 +2918,16 @@ optimize_load_fast(cfg_builder *g)
break;
}
case END_SEND:
case END_SEND: {
assert(_PyOpcode_num_popped(opcode, oparg) == 3);
assert(_PyOpcode_num_pushed(opcode, oparg) == 1);
ref tos = ref_stack_pop(&refs);
ref_stack_pop(&refs);
ref_stack_pop(&refs);
PUSH_REF(tos.instr, tos.local);
break;
}
case SET_FUNCTION_ATTRIBUTE: {
assert(_PyOpcode_num_popped(opcode, oparg) == 2);
assert(_PyOpcode_num_pushed(opcode, oparg) == 1);