mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
GH-118095: Add tier 2 support for YIELD_VALUE (GH-118380)
This commit is contained in:
parent
0f797402bc
commit
5b05d452cd
9 changed files with 92 additions and 16 deletions
14
Python/optimizer_cases.c.h
generated
14
Python/optimizer_cases.c.h
generated
|
|
@ -684,6 +684,13 @@
|
|||
|
||||
/* _INSTRUMENTED_YIELD_VALUE is not a viable micro-op for tier 2 */
|
||||
|
||||
case _YIELD_VALUE: {
|
||||
_Py_UopsSymbol *res;
|
||||
OUT_OF_SPACE_IF_NULL(res = sym_new_unknown(ctx));
|
||||
stack_pointer[-1] = res;
|
||||
break;
|
||||
}
|
||||
|
||||
case _POP_EXCEPT: {
|
||||
stack_pointer += -1;
|
||||
break;
|
||||
|
|
@ -1440,11 +1447,8 @@
|
|||
}
|
||||
|
||||
case _FOR_ITER_GEN_FRAME: {
|
||||
_PyInterpreterFrame *gen_frame;
|
||||
gen_frame = sym_new_not_null(ctx);
|
||||
if (gen_frame == NULL) goto out_of_space;
|
||||
stack_pointer[0] = (_Py_UopsSymbol *)gen_frame;
|
||||
stack_pointer += 1;
|
||||
/* We are about to hit the end of the trace */
|
||||
goto done;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue