Mercurial > cpython-lru_cache-weakref
annotate Include/opcode.h @ 1590:ac2e5cc29949 legacy-trunk
Added tests for missing host to open_http and open_gopher
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 18 Apr 1994 09:39:56 +0000 |
| parents | fccd415e2eb8 |
| children | 1940892d2fe3 |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
1 #ifndef Py_OPCODE_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
2 #define Py_OPCODE_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
6 |
| 145 | 7 /*********************************************************** |
|
1257
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
790
diff
changeset
|
8 Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, |
|
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
790
diff
changeset
|
9 Amsterdam, The Netherlands. |
| 145 | 10 |
| 11 All Rights Reserved | |
| 12 | |
| 13 Permission to use, copy, modify, and distribute this software and its | |
| 14 documentation for any purpose and without fee is hereby granted, | |
| 15 provided that the above copyright notice appear in all copies and that | |
| 16 both that copyright notice and this permission notice appear in | |
| 17 supporting documentation, and that the names of Stichting Mathematisch | |
| 18 Centrum or CWI not be used in advertising or publicity pertaining to | |
| 19 distribution of the software without specific, written prior permission. | |
| 20 | |
| 21 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO | |
| 22 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
| 23 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE | |
| 24 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| 25 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
| 26 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
| 27 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| 28 | |
| 29 ******************************************************************/ | |
| 30 | |
| 69 | 31 /* Instruction opcodes for compiled code */ |
| 32 | |
| 86 | 33 #define STOP_CODE 0 |
| 69 | 34 #define POP_TOP 1 |
| 35 #define ROT_TWO 2 | |
| 36 #define ROT_THREE 3 | |
| 86 | 37 #define DUP_TOP 4 |
| 69 | 38 |
| 39 #define UNARY_POSITIVE 10 | |
| 40 #define UNARY_NEGATIVE 11 | |
| 41 #define UNARY_NOT 12 | |
| 42 #define UNARY_CONVERT 13 | |
| 43 #define UNARY_CALL 14 | |
|
409
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
44 #define UNARY_INVERT 15 |
| 69 | 45 |
| 46 #define BINARY_MULTIPLY 20 | |
| 47 #define BINARY_DIVIDE 21 | |
| 48 #define BINARY_MODULO 22 | |
| 49 #define BINARY_ADD 23 | |
| 50 #define BINARY_SUBTRACT 24 | |
| 51 #define BINARY_SUBSCR 25 | |
| 52 #define BINARY_CALL 26 | |
| 53 | |
| 54 #define SLICE 30 | |
| 55 /* Also uses 31-33 */ | |
| 56 | |
| 57 #define STORE_SLICE 40 | |
| 58 /* Also uses 41-43 */ | |
| 59 | |
| 60 #define DELETE_SLICE 50 | |
| 61 /* Also uses 51-53 */ | |
| 62 | |
| 63 #define STORE_SUBSCR 60 | |
| 64 #define DELETE_SUBSCR 61 | |
| 65 | |
|
409
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
66 #define BINARY_LSHIFT 62 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
67 #define BINARY_RSHIFT 63 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
68 #define BINARY_AND 64 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
69 #define BINARY_XOR 65 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
70 #define BINARY_OR 66 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
71 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
178
diff
changeset
|
72 |
| 69 | 73 #define PRINT_EXPR 70 |
| 74 #define PRINT_ITEM 71 | |
| 75 #define PRINT_NEWLINE 72 | |
| 76 | |
| 77 #define BREAK_LOOP 80 | |
| 78 #define RAISE_EXCEPTION 81 | |
|
78
b1fb4e1f6e51
Added opcodes for classes.
Guido van Rossum <guido@python.org>
parents:
69
diff
changeset
|
79 #define LOAD_LOCALS 82 |
| 69 | 80 #define RETURN_VALUE 83 |
|
1354
fccd415e2eb8
* bltinmodule.c: removed exec() built-in function.
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
81 #define LOAD_GLOBALS 84 |
|
fccd415e2eb8
* bltinmodule.c: removed exec() built-in function.
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
82 #define EXEC_STMT 85 |
|
1262
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
83 |
| 69 | 84 #define BUILD_FUNCTION 86 |
| 85 #define POP_BLOCK 87 | |
| 86 #define END_FINALLY 88 | |
|
78
b1fb4e1f6e51
Added opcodes for classes.
Guido van Rossum <guido@python.org>
parents:
69
diff
changeset
|
87 #define BUILD_CLASS 89 |
| 69 | 88 |
| 89 #define HAVE_ARGUMENT 90 /* Opcodes from here have an argument: */ | |
| 90 | |
| 91 #define STORE_NAME 90 /* Index in name list */ | |
| 92 #define DELETE_NAME 91 /* "" */ | |
| 93 #define UNPACK_TUPLE 92 /* Number of tuple items */ | |
| 94 #define UNPACK_LIST 93 /* Number of list items */ | |
| 489 | 95 #define UNPACK_ARG 94 /* Number of arguments */ |
| 69 | 96 #define STORE_ATTR 95 /* Index in name list */ |
| 97 #define DELETE_ATTR 96 /* "" */ | |
| 474 | 98 #define STORE_GLOBAL 97 /* "" */ |
| 99 #define DELETE_GLOBAL 98 /* "" */ | |
| 592 | 100 #define UNPACK_VARARG 99 /* Minimal number of arguments */ |
| 69 | 101 |
| 102 #define LOAD_CONST 100 /* Index in const list */ | |
| 103 #define LOAD_NAME 101 /* Index in name list */ | |
| 104 #define BUILD_TUPLE 102 /* Number of tuple items */ | |
| 105 #define BUILD_LIST 103 /* Number of list items */ | |
| 106 #define BUILD_MAP 104 /* Always zero for now */ | |
| 107 #define LOAD_ATTR 105 /* Index in name list */ | |
| 108 #define COMPARE_OP 106 /* Comparison operator */ | |
| 109 #define IMPORT_NAME 107 /* Index in name list */ | |
| 110 #define IMPORT_FROM 108 /* Index in name list */ | |
|
1288
9fed5726a36d
Several changes in one:
Guido van Rossum <guido@python.org>
parents:
1262
diff
changeset
|
111 #define ACCESS_MODE 109 /* Name (mode is int on top of stack) */ |
| 69 | 112 |
| 113 #define JUMP_FORWARD 110 /* Number of bytes to skip */ | |
| 114 #define JUMP_IF_FALSE 111 /* "" */ | |
| 115 #define JUMP_IF_TRUE 112 /* "" */ | |
| 116 #define JUMP_ABSOLUTE 113 /* Target byte offset from beginning of code */ | |
| 117 #define FOR_LOOP 114 /* Number of bytes to skip */ | |
| 118 | |
|
178
fb6367d5ff46
Added opcodes to load local/global variables
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
119 #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
|
120 #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
|
121 |
| 69 | 122 #define SETUP_LOOP 120 /* Target address (absolute) */ |
| 123 #define SETUP_EXCEPT 121 /* "" */ | |
| 124 #define SETUP_FINALLY 122 /* "" */ | |
| 125 | |
|
1262
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
126 #define RESERVE_FAST 123 /* Number of local variables */ |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
127 #define LOAD_FAST 124 /* Local variable number */ |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
128 #define STORE_FAST 125 /* Local variable number */ |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
129 #define DELETE_FAST 126 /* Local variable number */ |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
130 |
| 86 | 131 #define SET_LINENO 127 /* Current line number */ |
| 132 | |
| 69 | 133 /* Comparison operator codes (argument to COMPARE_OP) */ |
| 134 enum cmp_op {LT, LE, EQ, NE, GT, GE, IN, NOT_IN, IS, IS_NOT, EXC_MATCH, BAD}; | |
| 86 | 135 |
| 136 #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT) | |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
137 |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
138 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
139 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
140 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
141 #endif /* !Py_OPCODE_H */ |
