opcode.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* Auto-generated by Tools/scripts/generate_opcode_h.py from Lib/opcode.py */
  2. #ifndef Py_OPCODE_H
  3. #define Py_OPCODE_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /* Instruction opcodes for compiled code */
  8. #define POP_TOP 1
  9. #define ROT_TWO 2
  10. #define ROT_THREE 3
  11. #define DUP_TOP 4
  12. #define DUP_TOP_TWO 5
  13. #define ROT_FOUR 6
  14. #define NOP 9
  15. #define UNARY_POSITIVE 10
  16. #define UNARY_NEGATIVE 11
  17. #define UNARY_NOT 12
  18. #define UNARY_INVERT 15
  19. #define BINARY_MATRIX_MULTIPLY 16
  20. #define INPLACE_MATRIX_MULTIPLY 17
  21. #define BINARY_POWER 19
  22. #define BINARY_MULTIPLY 20
  23. #define BINARY_MODULO 22
  24. #define BINARY_ADD 23
  25. #define BINARY_SUBTRACT 24
  26. #define BINARY_SUBSCR 25
  27. #define BINARY_FLOOR_DIVIDE 26
  28. #define BINARY_TRUE_DIVIDE 27
  29. #define INPLACE_FLOOR_DIVIDE 28
  30. #define INPLACE_TRUE_DIVIDE 29
  31. #define GET_AITER 50
  32. #define GET_ANEXT 51
  33. #define BEFORE_ASYNC_WITH 52
  34. #define BEGIN_FINALLY 53
  35. #define END_ASYNC_FOR 54
  36. #define INPLACE_ADD 55
  37. #define INPLACE_SUBTRACT 56
  38. #define INPLACE_MULTIPLY 57
  39. #define INPLACE_MODULO 59
  40. #define STORE_SUBSCR 60
  41. #define DELETE_SUBSCR 61
  42. #define BINARY_LSHIFT 62
  43. #define BINARY_RSHIFT 63
  44. #define BINARY_AND 64
  45. #define BINARY_XOR 65
  46. #define BINARY_OR 66
  47. #define INPLACE_POWER 67
  48. #define GET_ITER 68
  49. #define GET_YIELD_FROM_ITER 69
  50. #define PRINT_EXPR 70
  51. #define LOAD_BUILD_CLASS 71
  52. #define YIELD_FROM 72
  53. #define GET_AWAITABLE 73
  54. #define INPLACE_LSHIFT 75
  55. #define INPLACE_RSHIFT 76
  56. #define INPLACE_AND 77
  57. #define INPLACE_XOR 78
  58. #define INPLACE_OR 79
  59. #define WITH_CLEANUP_START 81
  60. #define WITH_CLEANUP_FINISH 82
  61. #define RETURN_VALUE 83
  62. #define IMPORT_STAR 84
  63. #define SETUP_ANNOTATIONS 85
  64. #define YIELD_VALUE 86
  65. #define POP_BLOCK 87
  66. #define END_FINALLY 88
  67. #define POP_EXCEPT 89
  68. #define HAVE_ARGUMENT 90
  69. #define STORE_NAME 90
  70. #define DELETE_NAME 91
  71. #define UNPACK_SEQUENCE 92
  72. #define FOR_ITER 93
  73. #define UNPACK_EX 94
  74. #define STORE_ATTR 95
  75. #define DELETE_ATTR 96
  76. #define STORE_GLOBAL 97
  77. #define DELETE_GLOBAL 98
  78. #define LOAD_CONST 100
  79. #define LOAD_NAME 101
  80. #define BUILD_TUPLE 102
  81. #define BUILD_LIST 103
  82. #define BUILD_SET 104
  83. #define BUILD_MAP 105
  84. #define LOAD_ATTR 106
  85. #define COMPARE_OP 107
  86. #define IMPORT_NAME 108
  87. #define IMPORT_FROM 109
  88. #define JUMP_FORWARD 110
  89. #define JUMP_IF_FALSE_OR_POP 111
  90. #define JUMP_IF_TRUE_OR_POP 112
  91. #define JUMP_ABSOLUTE 113
  92. #define POP_JUMP_IF_FALSE 114
  93. #define POP_JUMP_IF_TRUE 115
  94. #define LOAD_GLOBAL 116
  95. #define SETUP_FINALLY 122
  96. #define LOAD_FAST 124
  97. #define STORE_FAST 125
  98. #define DELETE_FAST 126
  99. #define RAISE_VARARGS 130
  100. #define CALL_FUNCTION 131
  101. #define MAKE_FUNCTION 132
  102. #define BUILD_SLICE 133
  103. #define LOAD_CLOSURE 135
  104. #define LOAD_DEREF 136
  105. #define STORE_DEREF 137
  106. #define DELETE_DEREF 138
  107. #define CALL_FUNCTION_KW 141
  108. #define CALL_FUNCTION_EX 142
  109. #define SETUP_WITH 143
  110. #define EXTENDED_ARG 144
  111. #define LIST_APPEND 145
  112. #define SET_ADD 146
  113. #define MAP_ADD 147
  114. #define LOAD_CLASSDEREF 148
  115. #define BUILD_LIST_UNPACK 149
  116. #define BUILD_MAP_UNPACK 150
  117. #define BUILD_MAP_UNPACK_WITH_CALL 151
  118. #define BUILD_TUPLE_UNPACK 152
  119. #define BUILD_SET_UNPACK 153
  120. #define SETUP_ASYNC_WITH 154
  121. #define FORMAT_VALUE 155
  122. #define BUILD_CONST_KEY_MAP 156
  123. #define BUILD_STRING 157
  124. #define BUILD_TUPLE_UNPACK_WITH_CALL 158
  125. #define LOAD_METHOD 160
  126. #define CALL_METHOD 161
  127. #define CALL_FINALLY 162
  128. #define POP_FINALLY 163
  129. /* EXCEPT_HANDLER is a special, implicit block type which is created when
  130. entering an except handler. It is not an opcode but we define it here
  131. as we want it to be available to both frameobject.c and ceval.c, while
  132. remaining private.*/
  133. #define EXCEPT_HANDLER 257
  134. enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE,
  135. PyCmp_GT=Py_GT, PyCmp_GE=Py_GE, PyCmp_IN, PyCmp_NOT_IN,
  136. PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD};
  137. #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141. #endif /* !Py_OPCODE_H */