You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
4.8 KiB

  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 PRINT_EXPR 70
  47. #define LOAD_BUILD_CLASS 71
  48. #define YIELD_FROM 72
  49. #define GET_AWAITABLE 73
  50. #define INPLACE_LSHIFT 75
  51. #define INPLACE_RSHIFT 76
  52. #define INPLACE_AND 77
  53. #define INPLACE_XOR 78
  54. #define INPLACE_OR 79
  55. #define BREAK_LOOP 80
  56. #define WITH_CLEANUP_START 81
  57. #define WITH_CLEANUP_FINISH 82
  58. #define RETURN_VALUE 83
  59. #define IMPORT_STAR 84
  60. #define YIELD_VALUE 86
  61. #define POP_BLOCK 87
  62. #define END_FINALLY 88
  63. #define POP_EXCEPT 89
  64. #define HAVE_ARGUMENT 90
  65. #define STORE_NAME 90
  66. #define DELETE_NAME 91
  67. #define UNPACK_SEQUENCE 92
  68. #define FOR_ITER 93
  69. #define UNPACK_EX 94
  70. #define STORE_ATTR 95
  71. #define DELETE_ATTR 96
  72. #define STORE_GLOBAL 97
  73. #define DELETE_GLOBAL 98
  74. #define LOAD_CONST 100
  75. #define LOAD_NAME 101
  76. #define BUILD_TUPLE 102
  77. #define BUILD_LIST 103
  78. #define BUILD_SET 104
  79. #define BUILD_MAP 105
  80. #define LOAD_ATTR 106
  81. #define COMPARE_OP 107
  82. #define IMPORT_NAME 108
  83. #define IMPORT_FROM 109
  84. #define JUMP_FORWARD 110
  85. #define JUMP_IF_FALSE_OR_POP 111
  86. #define JUMP_IF_TRUE_OR_POP 112
  87. #define JUMP_ABSOLUTE 113
  88. #define POP_JUMP_IF_FALSE 114
  89. #define POP_JUMP_IF_TRUE 115
  90. #define LOAD_GLOBAL 116
  91. #define CONTINUE_LOOP 119
  92. #define SETUP_LOOP 120
  93. #define SETUP_EXCEPT 121
  94. #define SETUP_FINALLY 122
  95. #define LOAD_FAST 124
  96. #define STORE_FAST 125
  97. #define DELETE_FAST 126
  98. #define RAISE_VARARGS 130
  99. #define CALL_FUNCTION 131
  100. #define MAKE_FUNCTION 132
  101. #define BUILD_SLICE 133
  102. #define MAKE_CLOSURE 134
  103. #define LOAD_CLOSURE 135
  104. #define LOAD_DEREF 136
  105. #define STORE_DEREF 137
  106. #define DELETE_DEREF 138
  107. #define CALL_FUNCTION_VAR 140
  108. #define CALL_FUNCTION_KW 141
  109. #define CALL_FUNCTION_VAR_KW 142
  110. #define SETUP_WITH 143
  111. #define EXTENDED_ARG 144
  112. #define LIST_APPEND 145
  113. #define SET_ADD 146
  114. #define MAP_ADD 147
  115. #define LOAD_CLASSDEREF 148
  116. #define BUILD_LIST_UNPACK 149
  117. #define BUILD_MAP_UNPACK 150
  118. #define BUILD_MAP_UNPACK_WITH_CALL 151
  119. #define BUILD_TUPLE_UNPACK 152
  120. #define BUILD_SET_UNPACK 153
  121. #define SETUP_ASYNC_WITH 154
  122. /* EXCEPT_HANDLER is a special, implicit block type which is created when
  123. entering an except handler. It is not an opcode but we define it here
  124. as we want it to be available to both frameobject.c and ceval.c, while
  125. remaining private.*/
  126. #define EXCEPT_HANDLER 257
  127. enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE,
  128. PyCmp_GT=Py_GT, PyCmp_GE=Py_GE, PyCmp_IN, PyCmp_NOT_IN,
  129. PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD};
  130. #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
  131. #ifdef __cplusplus
  132. }
  133. #endif
  134. #endif /* !Py_OPCODE_H */