aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2025-01-13 10:30:28 +0000
committerGitHub <noreply@github.com>2025-01-13 10:30:28 +0000
commitddd959987c557beaf823b681bf5e5e573ad657ac (patch)
treee59574d3eb62f94e497f7aecd585bf656ebc984e /Python/executor_cases.c.h
parent29fe8072cf404b891dde9c1d415095edddbe19de (diff)
downloadcpython-ddd959987c557beaf823b681bf5e5e573ad657ac.tar.gz
cpython-ddd959987c557beaf823b681bf5e5e573ad657ac.zip
GH-128685: Specialize (rather than quicken) LOAD_CONST into LOAD_CONST_[IM]MORTAL (GH-128708)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index e40fa88be89..e90d6b5ec10 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -209,10 +209,13 @@
break;
}
- case _LOAD_CONST: {
+ /* _LOAD_CONST is not a viable micro-op for tier 2 because it uses the 'this_instr' variable */
+
+ case _LOAD_CONST_MORTAL: {
_PyStackRef value;
oparg = CURRENT_OPARG();
- value = PyStackRef_FromPyObjectNew(GETITEM(FRAME_CO_CONSTS, oparg));
+ PyObject *obj = GETITEM(FRAME_CO_CONSTS, oparg);
+ value = PyStackRef_FromPyObjectNew(obj);
stack_pointer[0] = value;
stack_pointer += 1;
assert(WITHIN_STACK_BOUNDS());