summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-04-30 10:33:13 (GMT)
committerGitHub <noreply@github.com>2024-04-30 10:33:13 (GMT)
commit5b05d452cd20d9f0cfecdeec90adad3af5e4dfff (patch)
tree98991696903decd44fc348f6ac10f09b4c4785a5 /Python/optimizer_cases.c.h
parent0f797402bc77192c76a952410ca8e17359feab3c (diff)
downloadcpython-5b05d452cd20d9f0cfecdeec90adad3af5e4dfff.zip
cpython-5b05d452cd20d9f0cfecdeec90adad3af5e4dfff.tar.gz
cpython-5b05d452cd20d9f0cfecdeec90adad3af5e4dfff.tar.bz2
GH-118095: Add tier 2 support for YIELD_VALUE (GH-118380)
Diffstat (limited to 'Python/optimizer_cases.c.h')
-rw-r--r--Python/optimizer_cases.c.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h
index 4102d00..0b69692 100644
--- a/Python/optimizer_cases.c.h
+++ b/Python/optimizer_cases.c.h
@@ -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;
}