8 /* Instruction opcodes for compiled code */
18 #define UNARY_POSITIVE 10
19 #define UNARY_NEGATIVE 11
21 #define UNARY_CONVERT 13
23 #define UNARY_INVERT 15
25 #define LIST_APPEND 18
26 #define BINARY_POWER 19
28 #define BINARY_MULTIPLY 20
29 #define BINARY_DIVIDE 21
30 #define BINARY_MODULO 22
32 #define BINARY_SUBTRACT 24
33 #define BINARY_SUBSCR 25
34 #define BINARY_FLOOR_DIVIDE 26
35 #define BINARY_TRUE_DIVIDE 27
36 #define INPLACE_FLOOR_DIVIDE 28
37 #define INPLACE_TRUE_DIVIDE 29
42 #define STORE_SLICE 40
45 #define DELETE_SLICE 50
48 #define INPLACE_ADD 55
49 #define INPLACE_SUBTRACT 56
50 #define INPLACE_MULTIPLY 57
51 #define INPLACE_DIVIDE 58
52 #define INPLACE_MODULO 59
53 #define STORE_SUBSCR 60
54 #define DELETE_SUBSCR 61
56 #define BINARY_LSHIFT 62
57 #define BINARY_RSHIFT 63
61 #define INPLACE_POWER 67
66 #define PRINT_NEWLINE 72
67 #define PRINT_ITEM_TO 73
68 #define PRINT_NEWLINE_TO 74
69 #define INPLACE_LSHIFT 75
70 #define INPLACE_RSHIFT 76
71 #define INPLACE_AND 77
72 #define INPLACE_XOR 78
75 #define WITH_CLEANUP 81
76 #define LOAD_LOCALS 82
77 #define RETURN_VALUE 83
78 #define IMPORT_STAR 84
80 #define YIELD_VALUE 86
82 #define END_FINALLY 88
83 #define BUILD_CLASS 89
85 #define HAVE_ARGUMENT 90 /* Opcodes from here have an argument: */
87 #define STORE_NAME 90 /* Index in name list */
88 #define DELETE_NAME 91 /* "" */
89 #define UNPACK_SEQUENCE 92 /* Number of sequence items */
92 #define STORE_ATTR 95 /* Index in name list */
93 #define DELETE_ATTR 96 /* "" */
94 #define STORE_GLOBAL 97 /* "" */
95 #define DELETE_GLOBAL 98 /* "" */
96 #define DUP_TOPX 99 /* number of items to duplicate */
97 #define LOAD_CONST 100 /* Index in const list */
98 #define LOAD_NAME 101 /* Index in name list */
99 #define BUILD_TUPLE 102 /* Number of tuple items */
100 #define BUILD_LIST 103 /* Number of list items */
101 #define BUILD_MAP 104 /* Always zero for now */
102 #define LOAD_ATTR 105 /* Index in name list */
103 #define COMPARE_OP 106 /* Comparison operator */
104 #define IMPORT_NAME 107 /* Index in name list */
105 #define IMPORT_FROM 108 /* Index in name list */
107 #define JUMP_FORWARD 110 /* Number of bytes to skip */
108 #define JUMP_IF_FALSE 111 /* "" */
109 #define JUMP_IF_TRUE 112 /* "" */
110 #define JUMP_ABSOLUTE 113 /* Target byte offset from beginning of code */
112 #define LOAD_GLOBAL 116 /* Index in name list */
114 #define CONTINUE_LOOP 119 /* Start of loop (absolute) */
115 #define SETUP_LOOP 120 /* Target address (relative) */
116 #define SETUP_EXCEPT 121 /* "" */
117 #define SETUP_FINALLY 122 /* "" */
119 #define LOAD_FAST 124 /* Local variable number */
120 #define STORE_FAST 125 /* Local variable number */
121 #define DELETE_FAST 126 /* Local variable number */
123 #define RAISE_VARARGS 130 /* Number of raise arguments (1, 2 or 3) */
124 /* CALL_FUNCTION_XXX opcodes defined below depend on this definition */
125 #define CALL_FUNCTION 131 /* #args + (#kwargs<<8) */
126 #define MAKE_FUNCTION 132 /* #defaults */
127 #define BUILD_SLICE 133 /* Number of items */
129 #define MAKE_CLOSURE 134 /* #free vars */
130 #define LOAD_CLOSURE 135 /* Load free variable from closure */
131 #define LOAD_DEREF 136 /* Load and dereference from closure cell */
132 #define STORE_DEREF 137 /* Store into cell */
134 /* The next 3 opcodes must be contiguous and satisfy
135 (CALL_FUNCTION_VAR - CALL_FUNCTION) & 3 == 1 */
136 #define CALL_FUNCTION_VAR 140 /* #args + (#kwargs<<8) */
137 #define CALL_FUNCTION_KW 141 /* #args + (#kwargs<<8) */
138 #define CALL_FUNCTION_VAR_KW 142 /* #args + (#kwargs<<8) */
140 /* Support for opargs more than 16 bits long */
141 #define EXTENDED_ARG 143
144 enum cmp_op
{PyCmp_LT
=Py_LT
, PyCmp_LE
=Py_LE
, PyCmp_EQ
=Py_EQ
, PyCmp_NE
=Py_NE
, PyCmp_GT
=Py_GT
, PyCmp_GE
=Py_GE
,
145 PyCmp_IN
, PyCmp_NOT_IN
, PyCmp_IS
, PyCmp_IS_NOT
, PyCmp_EXC_MATCH
, PyCmp_BAD
};
147 #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
152 #endif /* !Py_OPCODE_H */