mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-119676: remove several pseudo instructions which are use only in codegen (#119677)
This commit is contained in:
parent
6b240c2308
commit
ae9140f32a
5 changed files with 23 additions and 71 deletions
|
@ -1812,18 +1812,6 @@ dummy_func(
|
|||
|
||||
macro(LOAD_SUPER_ATTR) = _SPECIALIZE_LOAD_SUPER_ATTR + _LOAD_SUPER_ATTR;
|
||||
|
||||
pseudo(LOAD_SUPER_METHOD) = {
|
||||
LOAD_SUPER_ATTR,
|
||||
};
|
||||
|
||||
pseudo(LOAD_ZERO_SUPER_METHOD) = {
|
||||
LOAD_SUPER_ATTR,
|
||||
};
|
||||
|
||||
pseudo(LOAD_ZERO_SUPER_ATTR) = {
|
||||
LOAD_SUPER_ATTR,
|
||||
};
|
||||
|
||||
inst(LOAD_SUPER_ATTR_ATTR, (unused/1, global_super, class, self -- attr, unused if (0))) {
|
||||
assert(!(oparg & 1));
|
||||
DEOPT_IF(global_super != (PyObject *)&PySuper_Type);
|
||||
|
@ -1925,10 +1913,6 @@ dummy_func(
|
|||
unused/8 +
|
||||
_LOAD_ATTR;
|
||||
|
||||
pseudo(LOAD_METHOD) = {
|
||||
LOAD_ATTR,
|
||||
};
|
||||
|
||||
op(_GUARD_TYPE_VERSION, (type_version/2, owner -- owner)) {
|
||||
PyTypeObject *tp = Py_TYPE(owner);
|
||||
assert(type_version != 0);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue