summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-05-28 19:05:38 (GMT)
committerGitHub <noreply@github.com>2024-05-28 19:05:38 (GMT)
commitae9140f32a1630838374f1af402291d4649a0be0 (patch)
tree35afdd4e502a0acef5dacfa0d26ad7ed92b9d1a8 /Python/compile.c
parent6b240c2308a044e38623900ccb8fa58c3549d4ae (diff)
downloadcpython-ae9140f32a1630838374f1af402291d4649a0be0.zip
cpython-ae9140f32a1630838374f1af402291d4649a0be0.tar.gz
cpython-ae9140f32a1630838374f1af402291d4649a0be0.tar.bz2
gh-119676: remove several pseudo instructions which are use only in codegen (#119677)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/Python/compile.c b/Python/compile.c
index cdc5b26..e6efae3 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -723,9 +723,6 @@ stack_effect(int opcode, int oparg, int jump)
case JUMP_NO_INTERRUPT:
return 0;
- case EXIT_INIT_CHECK:
- return -1;
-
/* Exception handling pseudo-instructions */
case SETUP_FINALLY:
/* 0 in the normal flow.
@@ -746,12 +743,6 @@ stack_effect(int opcode, int oparg, int jump)
return -1;
case LOAD_CLOSURE:
return 1;
- case LOAD_METHOD:
- return 1;
- case LOAD_SUPER_METHOD:
- case LOAD_ZERO_SUPER_METHOD:
- case LOAD_ZERO_SUPER_ATTR:
- return -1;
default:
return PY_INVALID_STACK_EFFECT;
}
@@ -997,6 +988,11 @@ compiler_addop_o(struct compiler_unit *u, location loc,
return codegen_addop_i(u->u_instr_sequence, opcode, arg, loc);
}
+#define LOAD_METHOD -1
+#define LOAD_SUPER_METHOD -2
+#define LOAD_ZERO_SUPER_ATTR -3
+#define LOAD_ZERO_SUPER_METHOD -4
+
static int
compiler_addop_name(struct compiler_unit *u, location loc,
int opcode, PyObject *dict, PyObject *o)
@@ -1014,7 +1010,6 @@ compiler_addop_name(struct compiler_unit *u, location loc,
arg <<= 1;
}
if (opcode == LOAD_METHOD) {
- assert(is_pseudo_target(LOAD_METHOD, LOAD_ATTR));
opcode = LOAD_ATTR;
arg <<= 1;
arg |= 1;
@@ -1024,18 +1019,15 @@ compiler_addop_name(struct compiler_unit *u, location loc,
arg |= 2;
}
if (opcode == LOAD_SUPER_METHOD) {
- assert(is_pseudo_target(LOAD_SUPER_METHOD, LOAD_SUPER_ATTR));
opcode = LOAD_SUPER_ATTR;
arg <<= 2;
arg |= 3;
}
if (opcode == LOAD_ZERO_SUPER_ATTR) {
- assert(is_pseudo_target(LOAD_ZERO_SUPER_ATTR, LOAD_SUPER_ATTR));
opcode = LOAD_SUPER_ATTR;
arg <<= 2;
}
if (opcode == LOAD_ZERO_SUPER_METHOD) {
- assert(is_pseudo_target(LOAD_ZERO_SUPER_METHOD, LOAD_SUPER_ATTR));
opcode = LOAD_SUPER_ATTR;
arg <<= 2;
arg |= 1;