@@ -134,9 +134,8 @@ enum {
134134int
135135_PyCompile_InstrSize (int opcode , int oparg )
136136{
137- assert (IS_PSEUDO_OPCODE (opcode ) == IS_PSEUDO_INSTR (opcode ));
138137 assert (!IS_PSEUDO_INSTR (opcode ));
139- assert (HAS_ARG (opcode ) || oparg == 0 );
138+ assert (OPCODE_HAS_ARG (opcode ) || oparg == 0 );
140139 int extended_args = (0xFFFFFF < oparg ) + (0xFFFF < oparg ) + (0xFF < oparg );
141140 int caches = _PyOpcode_Caches [opcode ];
142141 return extended_args + 1 + caches ;
@@ -248,15 +247,9 @@ instr_sequence_use_label(instr_sequence *seq, int lbl) {
248247static int
249248instr_sequence_addop (instr_sequence * seq , int opcode , int oparg , location loc )
250249{
251- /* compare old and new opcode macros - use ! to compare as bools. */
252- assert (!HAS_ARG (opcode ) == !OPCODE_HAS_ARG (opcode ));
253- assert (!HAS_CONST (opcode ) == !OPCODE_HAS_CONST (opcode ));
254- assert (!OPCODE_HAS_JUMP (opcode ) == !OPCODE_HAS_JUMP (opcode ));
255-
256250 assert (0 <= opcode && opcode <= MAX_OPCODE );
257- assert (IS_PSEUDO_OPCODE (opcode ) == IS_PSEUDO_INSTR (opcode ));
258251 assert (IS_WITHIN_OPCODE_RANGE (opcode ));
259- assert (HAS_ARG (opcode ) || HAS_TARGET (opcode ) || oparg == 0 );
252+ assert (OPCODE_HAS_ARG (opcode ) || HAS_TARGET (opcode ) || oparg == 0 );
260253 assert (0 <= oparg && oparg < (1 << 30 ));
261254
262255 int idx = instr_sequence_next_inst (seq );
@@ -874,7 +867,7 @@ PyCompile_OpcodeStackEffect(int opcode, int oparg)
874867static int
875868codegen_addop_noarg (instr_sequence * seq , int opcode , location loc )
876869{
877- assert (!HAS_ARG (opcode ));
870+ assert (!OPCODE_HAS_ARG (opcode ));
878871 assert (!IS_ASSEMBLER_OPCODE (opcode ));
879872 return instr_sequence_addop (seq , opcode , 0 , loc );
880873}
@@ -1151,7 +1144,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
11511144}
11521145
11531146#define ADDOP_N (C , LOC , OP , O , TYPE ) { \
1154- assert(!HAS_CONST (OP)); /* use ADDOP_LOAD_CONST_NEW */ \
1147+ assert(!OPCODE_HAS_CONST (OP)); /* use ADDOP_LOAD_CONST_NEW */ \
11551148 if (compiler_addop_o((C)->u, (LOC), (OP), (C)->u->u_metadata.u_ ## TYPE, (O)) < 0) { \
11561149 Py_DECREF((O)); \
11571150 return ERROR; \
@@ -7798,7 +7791,7 @@ instructions_to_instr_sequence(PyObject *instructions, instr_sequence *seq)
77987791 goto error ;
77997792 }
78007793 int oparg ;
7801- if (HAS_ARG (opcode )) {
7794+ if (OPCODE_HAS_ARG (opcode )) {
78027795 oparg = PyLong_AsLong (PyTuple_GET_ITEM (item , 1 ));
78037796 if (PyErr_Occurred ()) {
78047797 goto error ;
0 commit comments