]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Include/opcode.h
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 1/5.
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Include / opcode.h
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Include/opcode.h b/AppPkg/Applications/Python/Python-2.7.10/Include/opcode.h
new file mode 100644 (file)
index 0000000..fe2a690
--- /dev/null
@@ -0,0 +1,162 @@
+#ifndef Py_OPCODE_H\r
+#define Py_OPCODE_H\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+/* Instruction opcodes for compiled code */\r
+\r
+#define STOP_CODE      0\r
+#define POP_TOP                1\r
+#define ROT_TWO                2\r
+#define ROT_THREE      3\r
+#define DUP_TOP                4\r
+#define ROT_FOUR       5\r
+#define NOP            9\r
+\r
+#define UNARY_POSITIVE 10\r
+#define UNARY_NEGATIVE 11\r
+#define UNARY_NOT      12\r
+#define UNARY_CONVERT  13\r
+\r
+#define UNARY_INVERT   15\r
+\r
+#define BINARY_POWER   19\r
+\r
+#define BINARY_MULTIPLY        20\r
+#define BINARY_DIVIDE  21\r
+#define BINARY_MODULO  22\r
+#define BINARY_ADD     23\r
+#define BINARY_SUBTRACT        24\r
+#define BINARY_SUBSCR  25\r
+#define BINARY_FLOOR_DIVIDE 26\r
+#define BINARY_TRUE_DIVIDE 27\r
+#define INPLACE_FLOOR_DIVIDE 28\r
+#define INPLACE_TRUE_DIVIDE 29\r
+\r
+#define SLICE          30\r
+/* Also uses 31-33 */\r
+\r
+#define STORE_SLICE    40\r
+/* Also uses 41-43 */\r
+\r
+#define DELETE_SLICE   50\r
+/* Also uses 51-53 */\r
+\r
+#define STORE_MAP      54\r
+#define INPLACE_ADD    55\r
+#define INPLACE_SUBTRACT       56\r
+#define INPLACE_MULTIPLY       57\r
+#define INPLACE_DIVIDE 58\r
+#define INPLACE_MODULO 59\r
+#define STORE_SUBSCR   60\r
+#define DELETE_SUBSCR  61\r
+\r
+#define BINARY_LSHIFT  62\r
+#define BINARY_RSHIFT  63\r
+#define BINARY_AND     64\r
+#define BINARY_XOR     65\r
+#define BINARY_OR      66\r
+#define INPLACE_POWER  67\r
+#define GET_ITER       68\r
+\r
+#define PRINT_EXPR     70\r
+#define PRINT_ITEM     71\r
+#define PRINT_NEWLINE  72\r
+#define PRINT_ITEM_TO   73\r
+#define PRINT_NEWLINE_TO 74\r
+#define INPLACE_LSHIFT 75\r
+#define INPLACE_RSHIFT 76\r
+#define INPLACE_AND    77\r
+#define INPLACE_XOR    78\r
+#define INPLACE_OR     79\r
+#define BREAK_LOOP     80\r
+#define WITH_CLEANUP    81\r
+#define LOAD_LOCALS    82\r
+#define RETURN_VALUE   83\r
+#define IMPORT_STAR    84\r
+#define EXEC_STMT      85\r
+#define YIELD_VALUE    86\r
+#define POP_BLOCK      87\r
+#define END_FINALLY    88\r
+#define BUILD_CLASS    89\r
+\r
+#define HAVE_ARGUMENT  90      /* Opcodes from here have an argument: */\r
+\r
+#define STORE_NAME     90      /* Index in name list */\r
+#define DELETE_NAME    91      /* "" */\r
+#define UNPACK_SEQUENCE        92      /* Number of sequence items */\r
+#define FOR_ITER       93\r
+#define LIST_APPEND    94\r
+\r
+#define STORE_ATTR     95      /* Index in name list */\r
+#define DELETE_ATTR    96      /* "" */\r
+#define STORE_GLOBAL   97      /* "" */\r
+#define DELETE_GLOBAL  98      /* "" */\r
+#define DUP_TOPX       99      /* number of items to duplicate */\r
+#define LOAD_CONST     100     /* Index in const list */\r
+#define LOAD_NAME      101     /* Index in name list */\r
+#define BUILD_TUPLE    102     /* Number of tuple items */\r
+#define BUILD_LIST     103     /* Number of list items */\r
+#define BUILD_SET      104     /* Number of set items */\r
+#define BUILD_MAP      105     /* Always zero for now */\r
+#define LOAD_ATTR      106     /* Index in name list */\r
+#define COMPARE_OP     107     /* Comparison operator */\r
+#define IMPORT_NAME    108     /* Index in name list */\r
+#define IMPORT_FROM    109     /* Index in name list */\r
+#define JUMP_FORWARD   110     /* Number of bytes to skip */\r
+\r
+#define JUMP_IF_FALSE_OR_POP 111 /* Target byte offset from beginning\r
+                                    of code */\r
+#define JUMP_IF_TRUE_OR_POP 112        /* "" */\r
+#define JUMP_ABSOLUTE  113     /* "" */\r
+#define POP_JUMP_IF_FALSE 114  /* "" */\r
+#define POP_JUMP_IF_TRUE 115   /* "" */\r
+\r
+#define LOAD_GLOBAL    116     /* Index in name list */\r
+\r
+#define CONTINUE_LOOP  119     /* Start of loop (absolute) */\r
+#define SETUP_LOOP     120     /* Target address (relative) */\r
+#define SETUP_EXCEPT   121     /* "" */\r
+#define SETUP_FINALLY  122     /* "" */\r
+\r
+#define LOAD_FAST      124     /* Local variable number */\r
+#define STORE_FAST     125     /* Local variable number */\r
+#define DELETE_FAST    126     /* Local variable number */\r
+\r
+#define RAISE_VARARGS  130     /* Number of raise arguments (1, 2 or 3) */\r
+/* CALL_FUNCTION_XXX opcodes defined below depend on this definition */\r
+#define CALL_FUNCTION  131     /* #args + (#kwargs<<8) */\r
+#define MAKE_FUNCTION  132     /* #defaults */\r
+#define BUILD_SLICE    133     /* Number of items */\r
+\r
+#define MAKE_CLOSURE    134     /* #free vars */\r
+#define LOAD_CLOSURE    135     /* Load free variable from closure */\r
+#define LOAD_DEREF      136     /* Load and dereference from closure cell */ \r
+#define STORE_DEREF     137     /* Store into cell */ \r
+\r
+/* The next 3 opcodes must be contiguous and satisfy\r
+   (CALL_FUNCTION_VAR - CALL_FUNCTION) & 3 == 1  */\r
+#define CALL_FUNCTION_VAR          140 /* #args + (#kwargs<<8) */\r
+#define CALL_FUNCTION_KW           141 /* #args + (#kwargs<<8) */\r
+#define CALL_FUNCTION_VAR_KW       142 /* #args + (#kwargs<<8) */\r
+\r
+#define SETUP_WITH 143\r
+\r
+/* Support for opargs more than 16 bits long */\r
+#define EXTENDED_ARG  145\r
+\r
+#define SET_ADD         146\r
+#define MAP_ADD         147\r
+\r
+\r
+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,\r
+            PyCmp_IN, PyCmp_NOT_IN, PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD};\r
+\r
+#define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+#endif /* !Py_OPCODE_H */\r