Lines Matching defs:opcode

91 #define IS_WITHIN_OPCODE_RANGE(opcode) \
92 ((opcode) >= MIN_VIRTUAL_OPCODE && (opcode) <= MAX_ALLOWED_OPCODE)
94 #define IS_VIRTUAL_OPCODE(opcode) ((opcode) < 0)
96 #define IS_VIRTUAL_JUMP_OPCODE(opcode) \
97 ((opcode) == JUMP || \
98 (opcode) == JUMP_NO_INTERRUPT || \
99 (opcode) == POP_JUMP_IF_NONE || \
100 (opcode) == POP_JUMP_IF_NOT_NONE || \
101 (opcode) == POP_JUMP_IF_FALSE || \
102 (opcode) == POP_JUMP_IF_TRUE)
105 #define IS_ASSEMBLER_OPCODE(opcode) \
106 ((opcode) == JUMP_FORWARD || \
107 (opcode) == JUMP_BACKWARD || \
108 (opcode) == JUMP_BACKWARD_NO_INTERRUPT || \
109 (opcode) == POP_JUMP_FORWARD_IF_NONE || \
110 (opcode) == POP_JUMP_BACKWARD_IF_NONE || \
111 (opcode) == POP_JUMP_FORWARD_IF_NOT_NONE || \
112 (opcode) == POP_JUMP_BACKWARD_IF_NOT_NONE || \
113 (opcode) == POP_JUMP_FORWARD_IF_TRUE || \
114 (opcode) == POP_JUMP_BACKWARD_IF_TRUE || \
115 (opcode) == POP_JUMP_FORWARD_IF_FALSE || \
116 (opcode) == POP_JUMP_BACKWARD_IF_FALSE)
119 #define IS_BACKWARDS_JUMP_OPCODE(opcode) \
120 ((opcode) == JUMP_BACKWARD || \
121 (opcode) == JUMP_BACKWARD_NO_INTERRUPT || \
122 (opcode) == POP_JUMP_BACKWARD_IF_NONE || \
123 (opcode) == POP_JUMP_BACKWARD_IF_NOT_NONE || \
124 (opcode) == POP_JUMP_BACKWARD_IF_TRUE || \
125 (opcode) == POP_JUMP_BACKWARD_IF_FALSE)
183 int opcode = instr->i_opcode;
184 return opcode == SETUP_FINALLY || opcode == SETUP_WITH || opcode == SETUP_CLEANUP;
197 int opcode = instruction->i_opcode;
198 assert(!IS_VIRTUAL_OPCODE(opcode));
199 int oparg = HAS_ARG(opcode) ? instruction->i_oparg : 0;
201 int caches = _PyOpcode_Caches[opcode];
208 int opcode = instruction->i_opcode;
209 assert(!IS_VIRTUAL_OPCODE(opcode));
210 int oparg = HAS_ARG(opcode) ? instruction->i_oparg : 0;
211 int caches = _PyOpcode_Caches[opcode];
223 *codestr++ = _Py_MAKECODEUNIT(opcode, oparg & 0xFF);
263 /* b_return is true if a RETURN_VALUE opcode is inserted. */
934 /* Return the stack effect of opcode with argument oparg.
944 stack_effect(int opcode, int oparg, int jump)
946 switch (opcode) {
1200 PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump)
1202 return stack_effect(opcode, oparg, jump);
1206 PyCompile_OpcodeStackEffect(int opcode, int oparg)
1208 return stack_effect(opcode, oparg, -1);
1213 int opcode = instr->i_opcode;
1216 opcode == RETURN_VALUE ||
1217 opcode == RAISE_VARARGS ||
1218 opcode == RERAISE;
1242 /* Add an opcode with no argument.
1247 compiler_addop_line(struct compiler *c, int opcode, int line,
1250 assert(IS_WITHIN_OPCODE_RANGE(opcode));
1251 assert(!IS_ASSEMBLER_OPCODE(opcode));
1252 assert(!HAS_ARG(opcode) || IS_ARTIFICIAL(opcode));
1264 i->i_opcode = opcode;
1266 if (opcode == RETURN_VALUE) {
1279 compiler_addop(struct compiler *c, int opcode)
1281 return compiler_addop_line(c, opcode, c->u->u_lineno, c->u->u_end_lineno,
1286 compiler_addop_noline(struct compiler *c, int opcode)
1288 return compiler_addop_line(c, opcode, -1, 0, 0, 0);
1452 compiler_addop_o(struct compiler *c, int opcode, PyObject *dict,
1458 return compiler_addop_i(c, opcode, arg);
1462 compiler_addop_name(struct compiler *c, int opcode, PyObject *dict,
1474 return compiler_addop_i(c, opcode, arg);
1477 /* Add an opcode with an integer argument.
1482 compiler_addop_i_line(struct compiler *c, int opcode, Py_ssize_t oparg,
1494 assert(IS_WITHIN_OPCODE_RANGE(opcode));
1495 assert(!IS_ASSEMBLER_OPCODE(opcode));
1496 assert(HAS_ARG(opcode));
1509 i->i_opcode = opcode;
1521 compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg)
1523 return compiler_addop_i_line(c, opcode, oparg,
1529 compiler_addop_i_noline(struct compiler *c, int opcode, Py_ssize_t oparg)
1531 return compiler_addop_i_line(c, opcode, oparg, -1, 0, 0, 0);
1534 static int add_jump_to_block(struct compiler *c, int opcode,
1539 assert(IS_WITHIN_OPCODE_RANGE(opcode));
1540 assert(!IS_ASSEMBLER_OPCODE(opcode));
1541 assert(HAS_ARG(opcode) || IS_VIRTUAL_OPCODE(opcode));
1554 i->i_opcode = opcode;
1566 compiler_addop_j(struct compiler *c, int opcode, basicblock *b)
1568 return add_jump_to_block(c, opcode, c->u->u_lineno,
1574 compiler_addop_j_noline(struct compiler *c, int opcode, basicblock *b)
1576 return add_jump_to_block(c, opcode, -1, 0, 0, 0, b);
3877 /* The IMPORT_NAME opcode was already generated. This function
5015 /* Evaluate the format spec, and update our opcode arg. */
5020 /* And push our opcode and oparg */
7188 "compiler stack_effect(opcode=%d, arg=%i) failed",
7285 int opcode = setup->i_opcode;
7287 if (opcode == SETUP_WITH || opcode == SETUP_CLEANUP) {
8090 fprintf(stderr, "line: %d, opcode: %d %s%s%s\n",
8511 get_const_value(int opcode, int oparg, PyObject *co_consts)
8514 assert(HAS_CONST(opcode));
8515 if (opcode == LOAD_CONST) {
8614 int opcode = instructions[len].i_opcode;
8615 if (opcode == SWAP) {
8619 else if (opcode != NOP) {
8699 #define SWAPPABLE(opcode) \
8700 ((opcode) == STORE_FAST || (opcode) == POP_TOP)
8782 // target->i_target using the provided opcode. Return whether or not the
8785 jump_thread(struct instr *inst, struct instr *target, int opcode)
8787 assert(!IS_VIRTUAL_OPCODE(opcode) || IS_VIRTUAL_JUMP_OPCODE(opcode));
8796 inst->i_opcode = opcode;