summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2025-03-20 11:42:54 (GMT)
committerGitHub <noreply@github.com>2025-03-20 11:42:54 (GMT)
commit83d54fa8760f54935086bb40a2e721f927e705b9 (patch)
tree6fa1485d5e8a2ba080d60ecb71794e5c25028f38 /Python
parentb69da006a4f493f1eec0df413f81fbfc3e366783 (diff)
downloadcpython-83d54fa8760f54935086bb40a2e721f927e705b9.zip
cpython-83d54fa8760f54935086bb40a2e721f927e705b9.tar.gz
cpython-83d54fa8760f54935086bb40a2e721f927e705b9.tar.bz2
GH-130296: Remove `_PyOpcode_max_stack_effect` as it is no longer used (GH-131493)
Diffstat (limited to 'Python')
-rw-r--r--Python/flowgraph.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index cf3e740..4f101a6 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -760,11 +760,6 @@ make_cfg_traversal_stack(basicblock *entryblock) {
typedef struct {
/* The stack effect of the instruction. */
int net;
-
- /* The maximum stack usage of the instruction. Some instructions may
- * temporarily push extra values to the stack while they are executing.
- */
- int max;
} stack_effects;
Py_LOCAL(int)
@@ -784,14 +779,9 @@ get_stack_effects(int opcode, int oparg, int jump, stack_effects *effects)
}
if (IS_BLOCK_PUSH_OPCODE(opcode) && !jump) {
effects->net = 0;
- effects->max = 0;
return 0;
}
- if (_PyOpcode_max_stack_effect(opcode, oparg, &effects->max) < 0) {
- return -1;
- }
effects->net = pushed - popped;
- assert(effects->max >= effects->net);
return 0;
}
@@ -852,7 +842,7 @@ calculate_stackdepth(cfg_builder *g)
"Invalid CFG, stack underflow");
goto error;
}
- maxdepth = Py_MAX(maxdepth, depth + effects.max);
+ maxdepth = Py_MAX(maxdepth, depth);
if (HAS_TARGET(instr->i_opcode) && instr->i_opcode != END_ASYNC_FOR) {
if (get_stack_effects(instr->i_opcode, instr->i_oparg, 1, &effects) < 0) {
PyErr_Format(PyExc_SystemError,
@@ -862,7 +852,7 @@ calculate_stackdepth(cfg_builder *g)
}
int target_depth = depth + effects.net;
assert(target_depth >= 0); /* invalid code or bug in stackdepth() */
- maxdepth = Py_MAX(maxdepth, depth + effects.max);
+ maxdepth = Py_MAX(maxdepth, depth);
if (stackdepth_push(&sp, instr->i_target, target_depth) < 0) {
goto error;
}