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

@ -1038,7 +1038,7 @@ dummy_func(void) {
gen_frame = PyJitRef_WrapInvalid(new_frame);
}
op(_SEND_GEN_FRAME, (receiver, v -- receiver, gen_frame)) {
op(_SEND_GEN_FRAME, (receiver, null, v -- receiver, null, gen_frame)) {
_Py_UOpsAbstractFrame *new_frame = frame_new_from_symbol(ctx, receiver, NULL, 0);
if (new_frame == NULL) {
ctx->done = true;
@ -1779,6 +1779,12 @@ dummy_func(void) {
sym_set_recorded_gen_func(nos, func);
}
op(_RECORD_3OS_GEN_FUNC, (gen, nos, tos -- gen, nos, tos)) {
PyFunctionObject *func = (PyFunctionObject *)this_instr->operand0;
assert(func == NULL || PyFunction_Check(func));
sym_set_recorded_gen_func(gen, func);
}
op(_GUARD_CODE_VERSION__PUSH_FRAME, (version/2 -- )) {
PyCodeObject *co = get_current_code_object(ctx);
if (co->co_version == version) {