Mercurial > cpython-lru_cache-weakref
annotate Include/opcode.h @ 892:11ea669c231e legacy-trunk
Documented new contents of lib5.tex
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 03 Jun 1992 17:56:44 +0000 |
| parents | 164849f56105 |
| children | 1cabc2b6c970 |
| rev | line source |
|---|---|
| 145 | 1 /*********************************************************** |
|
790
164849f56105
Copyright for 1992 added
Guido van Rossum <guido@python.org>
parents:
592
diff
changeset
|
2 Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The |
| 145 | 3 Netherlands. |
| 4 | |
| 5 All Rights Reserved | |
| 6 | |
| 7 Permission to use, copy, modify, and distribute this software and its | |
| 8 documentation for any purpose and without fee is hereby granted, | |
| 9 provided that the above copyright notice appear in all copies and that | |
| 10 both that copyright notice and this permission notice appear in | |
| 11 supporting documentation, and that the names of Stichting Mathematisch | |
| 12 Centrum or CWI not be used in advertising or publicity pertaining to | |
| 13 distribution of the software without specific, written prior permission. | |
| 14 | |
| 15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO | |
| 16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
| 17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE | |
| 18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| 19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
| 20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
| 21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| 22 | |
| 23 ******************************************************************/ | |
| 24 | |
| 69 | 25 /* Instruction opcodes for compiled code */ |
| 26 | |
| 86 | 27 #define STOP_CODE 0 |
| 69 | 28 #define POP_TOP 1 |
| 29 #define ROT_TWO 2 | |
| 30 #define ROT_THREE 3 | |
| 86 | 31 #define DUP_TOP 4 |
| 69 | 32 |
| 33 #define UNARY_POSITIVE 10 | |
| 34 #define UNARY_NEGATIVE 11 | |
| 35 #define UNARY_NOT 12 | |
| 36 #define UNARY_CONVERT 13 | |
| 37 #define UNARY_CALL 14 | |
|
409
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
38 #define UNARY_INVERT 15 |
| 69 | 39 |
| 40 #define BINARY_MULTIPLY 20 | |
| 41 #define BINARY_DIVIDE 21 | |
| 42 #define BINARY_MODULO 22 | |
| 43 #define BINARY_ADD 23 | |
| 44 #define BINARY_SUBTRACT 24 | |
| 45 #define BINARY_SUBSCR 25 | |
| 46 #define BINARY_CALL 26 | |
| 47 | |
| 48 #define SLICE 30 | |
| 49 /* Also uses 31-33 */ | |
| 50 | |
| 51 #define STORE_SLICE 40 | |
| 52 /* Also uses 41-43 */ | |
| 53 | |
| 54 #define DELETE_SLICE 50 | |
| 55 /* Also uses 51-53 */ | |
| 56 | |
| 57 #define STORE_SUBSCR 60 | |
| 58 #define DELETE_SUBSCR 61 | |
| 59 | |
|
409
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
60 #define BINARY_LSHIFT 62 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
61 #define BINARY_RSHIFT 63 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
62 #define BINARY_AND 64 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
63 #define BINARY_XOR 65 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
64 #define BINARY_OR 66 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
65 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
66 |
| 69 | 67 #define PRINT_EXPR 70 |
| 68 #define PRINT_ITEM 71 | |
| 69 #define PRINT_NEWLINE 72 | |
| 70 | |
| 71 #define BREAK_LOOP 80 | |
| 72 #define RAISE_EXCEPTION 81 | |
|
78
b1fb4e1f6e51
Added opcodes for classes.
Guido van Rossum <guido@python.org>
parents:
69
diff
changeset
|
73 #define LOAD_LOCALS 82 |
| 69 | 74 #define RETURN_VALUE 83 |
| 489 | 75 /* |
| 69 | 76 #define REQUIRE_ARGS 84 |
| 77 #define REFUSE_ARGS 85 | |
| 489 | 78 */ |
| 69 | 79 #define BUILD_FUNCTION 86 |
| 80 #define POP_BLOCK 87 | |
| 81 #define END_FINALLY 88 | |
|
78
b1fb4e1f6e51
Added opcodes for classes.
Guido van Rossum <guido@python.org>
parents:
69
diff
changeset
|
82 #define BUILD_CLASS 89 |
| 69 | 83 |
| 84 #define HAVE_ARGUMENT 90 /* Opcodes from here have an argument: */ | |
| 85 | |
| 86 #define STORE_NAME 90 /* Index in name list */ | |
| 87 #define DELETE_NAME 91 /* "" */ | |
| 88 #define UNPACK_TUPLE 92 /* Number of tuple items */ | |
| 89 #define UNPACK_LIST 93 /* Number of list items */ | |
| 489 | 90 #define UNPACK_ARG 94 /* Number of arguments */ |
| 69 | 91 #define STORE_ATTR 95 /* Index in name list */ |
| 92 #define DELETE_ATTR 96 /* "" */ | |
| 474 | 93 #define STORE_GLOBAL 97 /* "" */ |
| 94 #define DELETE_GLOBAL 98 /* "" */ | |
| 592 | 95 #define UNPACK_VARARG 99 /* Minimal number of arguments */ |
| 69 | 96 |
| 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 */ | |
| 106 | |
| 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 */ | |
| 111 #define FOR_LOOP 114 /* Number of bytes to skip */ | |
| 112 | |
|
178
fb6367d5ff46
Added opcodes to load local/global variables
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
113 #define LOAD_LOCAL 115 /* Index in name list */ |
|
fb6367d5ff46
Added opcodes to load local/global variables
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
114 #define LOAD_GLOBAL 116 /* Index in name list */ |
|
fb6367d5ff46
Added opcodes to load local/global variables
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
115 |
| 69 | 116 #define SETUP_LOOP 120 /* Target address (absolute) */ |
| 117 #define SETUP_EXCEPT 121 /* "" */ | |
| 118 #define SETUP_FINALLY 122 /* "" */ | |
| 119 | |
| 86 | 120 #define SET_LINENO 127 /* Current line number */ |
| 121 | |
| 69 | 122 /* Comparison operator codes (argument to COMPARE_OP) */ |
| 123 enum cmp_op {LT, LE, EQ, NE, GT, GE, IN, NOT_IN, IS, IS_NOT, EXC_MATCH, BAD}; | |
| 86 | 124 |
| 125 #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT) |
