opcode.h 4.8 KB

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