summaryrefslogtreecommitdiffstats
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-01-24 12:08:31 (GMT)
committerGitHub <noreply@github.com>2024-01-24 12:08:31 (GMT)
commit384429d1c0cf011dcf88d4043e0328de8b063c24 (patch)
treed3b325f08d9359bce60065b162ddec3572b08662 /Python/executor_cases.c.h
parent1e4f00ebd8db44a031b61eed0803b4c3d731aed7 (diff)
downloadcpython-384429d1c0cf011dcf88d4043e0328de8b063c24.zip
cpython-384429d1c0cf011dcf88d4043e0328de8b063c24.tar.gz
cpython-384429d1c0cf011dcf88d4043e0328de8b063c24.tar.bz2
GH-113710: Add a tier 2 peephole optimization pass. (GH-114487)
* Convert _LOAD_CONST to inline versions * Remove PEP 523 checks
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 2b4399b..241b905 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -3390,6 +3390,15 @@
break;
}
+ case _LOAD_CONST_INLINE: {
+ PyObject *value;
+ PyObject *ptr = (PyObject *)CURRENT_OPERAND();
+ value = Py_NewRef(ptr);
+ stack_pointer[0] = value;
+ stack_pointer += 1;
+ break;
+ }
+
case _LOAD_CONST_INLINE_BORROW: {
PyObject *value;
PyObject *ptr = (PyObject *)CURRENT_OPERAND();