summaryrefslogtreecommitdiffstats
path: root/Python/optimizer.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2025-03-20 15:39:38 (GMT)
committerGitHub <noreply@github.com>2025-03-20 15:39:38 (GMT)
commit7ebd71ee14a497bb5dc7a693dd00f074a9f4831f (patch)
tree15c6214a266592b9ade709dd45c818a5f972f0a4 /Python/optimizer.c
parent443c0cd17c5b0c71ee45c3621777454c6b8b0cbd (diff)
downloadcpython-7ebd71ee14a497bb5dc7a693dd00f074a9f4831f.zip
cpython-7ebd71ee14a497bb5dc7a693dd00f074a9f4831f.tar.gz
cpython-7ebd71ee14a497bb5dc7a693dd00f074a9f4831f.tar.bz2
GH-131498: Remove conditional stack effects (GH-131499)
* Adds some missing #includes
Diffstat (limited to 'Python/optimizer.c')
-rw-r--r--Python/optimizer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c
index 6fc5eab..e2fe0f6 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -6,11 +6,15 @@
#include "pycore_interp.h"
#include "pycore_backoff.h"
#include "pycore_bitutils.h" // _Py_popcount32()
+#include "pycore_code.h" // _Py_GetBaseCodeUnit
+#include "pycore_interpframe.h"
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_opcode_metadata.h" // _PyOpcode_OpName[]
#include "pycore_opcode_utils.h" // MAX_REAL_OPCODE
#include "pycore_optimizer.h" // _Py_uop_analyze_and_optimize()
#include "pycore_pystate.h" // _PyInterpreterState_GET()
+#include "pycore_tuple.h" // _PyTuple_FromArraySteal
+#include "pycore_unicodeobject.h" // _PyUnicode_FromASCII
#include "pycore_uop_ids.h"
#include "pycore_jit.h"
#include <stdbool.h>
@@ -1226,11 +1230,7 @@ uop_optimize(
for (int pc = 0; pc < length; pc++) {
int opcode = buffer[pc].opcode;
int oparg = buffer[pc].oparg;
- if (_PyUop_Flags[opcode] & HAS_OPARG_AND_1_FLAG) {
- buffer[pc].opcode = opcode + 1 + (oparg & 1);
- assert(strncmp(_PyOpcode_uop_name[buffer[pc].opcode], _PyOpcode_uop_name[opcode], strlen(_PyOpcode_uop_name[opcode])) == 0);
- }
- else if (oparg < _PyUop_Replication[opcode]) {
+ if (oparg < _PyUop_Replication[opcode]) {
buffer[pc].opcode = opcode + oparg + 1;
assert(strncmp(_PyOpcode_uop_name[buffer[pc].opcode], _PyOpcode_uop_name[opcode], strlen(_PyOpcode_uop_name[opcode])) == 0);
}