summaryrefslogtreecommitdiffstats
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-11-14 15:30:33 (GMT)
committerGitHub <noreply@github.com>2023-11-14 15:30:33 (GMT)
commita519b87958da0b340caef48349d6e3c23c98e47e (patch)
treedb7ddda2fae058c072c214bb3e8e58c11dc6bfa8 /Python/executor_cases.c.h
parentb11c443bb2ebfdd009e43ff208fa6324b658d15d (diff)
downloadcpython-a519b87958da0b340caef48349d6e3c23c98e47e.zip
cpython-a519b87958da0b340caef48349d6e3c23c98e47e.tar.gz
cpython-a519b87958da0b340caef48349d6e3c23c98e47e.tar.bz2
GH-111848: Convert remaining jumps to deopts into tier 2 code. (GH-112045)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index ac542a5..4e29fb9 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -3185,22 +3185,37 @@
break;
}
- case _POP_JUMP_IF_FALSE: {
+ case _GUARD_IS_TRUE_POP: {
PyObject *flag;
flag = stack_pointer[-1];
- if (Py_IsFalse(flag)) {
- next_uop = current_executor->trace + oparg;
- }
+ DEOPT_IF(Py_IsFalse(flag), _GUARD_IS_TRUE_POP);
+ assert(Py_IsTrue(flag));
STACK_SHRINK(1);
break;
}
- case _POP_JUMP_IF_TRUE: {
+ case _GUARD_IS_FALSE_POP: {
PyObject *flag;
flag = stack_pointer[-1];
- if (Py_IsTrue(flag)) {
- next_uop = current_executor->trace + oparg;
- }
+ DEOPT_IF(Py_IsTrue(flag), _GUARD_IS_FALSE_POP);
+ assert(Py_IsFalse(flag));
+ STACK_SHRINK(1);
+ break;
+ }
+
+ case _GUARD_IS_NONE_POP: {
+ PyObject *val;
+ val = stack_pointer[-1];
+ DEOPT_IF(!Py_IsNone(val), _GUARD_IS_NONE_POP);
+ STACK_SHRINK(1);
+ break;
+ }
+
+ case _GUARD_IS_NOT_NONE_POP: {
+ PyObject *val;
+ val = stack_pointer[-1];
+ DEOPT_IF(Py_IsNone(val), _GUARD_IS_NOT_NONE_POP);
+ Py_DECREF(val);
STACK_SHRINK(1);
break;
}