annotate Include/opcode.h @ 87690:66c1c9f32567 default tip

Add use_weakref option to functools.lru_cache The use_weakref option makes lru_cache create weak references to the function arguments when creating the cache key, which prevents them from staying in the memory forever even after all other references to them are gone. This is a proof of concept for http://bugs.python.org/issue19859
author Radomir Dopieralski <devel@sheep.art.pl>
date Tue, 03 Dec 2013 16:02:48 +0100
parents 6db3741e59be
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
853b736a6a9e Added copyright notice.
Guido van Rossum <guido@python.org>
parents: 86
diff changeset
7
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 /* Instruction opcodes for compiled code */
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
10 #define POP_TOP 1
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
11 #define ROT_TWO 2
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
12 #define ROT_THREE 3
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
13 #define DUP_TOP 4
64439
725231211273 Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced
Antoine Pitrou <solipsis@pitrou.net>
parents: 63114
diff changeset
14 #define DUP_TOP_TWO 5
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
15 #define NOP 9
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
16
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
17 #define UNARY_POSITIVE 10
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
18 #define UNARY_NEGATIVE 11
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
19 #define UNARY_NOT 12
2841
64928f6a8e80 keyword arguments and faster function calls
Guido van Rossum <guido@python.org>
parents: 2803
diff changeset
20
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
21 #define UNARY_INVERT 15
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
22
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
23 #define BINARY_POWER 19
3320
4e6d0b26efaf changes for ** (power) operator
Guido van Rossum <guido@python.org>
parents: 2841
diff changeset
24
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
25 #define BINARY_MULTIPLY 20
37014
25007c155668 Get rid of last vestiges of BINARY_DIVIDE.
Neal Norwitz <nnorwitz@gmail.com>
parents: 36695
diff changeset
26
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
27 #define BINARY_MODULO 22
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
28 #define BINARY_ADD 23
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
29 #define BINARY_SUBTRACT 24
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
30 #define BINARY_SUBSCR 25
19051
f20727cc3d0f Implement PEP 238 in its (almost) full glory.
Guido van Rossum <guido@python.org>
parents: 18148
diff changeset
31 #define BINARY_FLOOR_DIVIDE 26
f20727cc3d0f Implement PEP 238 in its (almost) full glory.
Guido van Rossum <guido@python.org>
parents: 18148
diff changeset
32 #define BINARY_TRUE_DIVIDE 27
f20727cc3d0f Implement PEP 238 in its (almost) full glory.
Guido van Rossum <guido@python.org>
parents: 18148
diff changeset
33 #define INPLACE_FLOOR_DIVIDE 28
f20727cc3d0f Implement PEP 238 in its (almost) full glory.
Guido van Rossum <guido@python.org>
parents: 18148
diff changeset
34 #define INPLACE_TRUE_DIVIDE 29
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
35
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
36 #define STORE_MAP 54
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
37 #define INPLACE_ADD 55
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
38 #define INPLACE_SUBTRACT 56
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
39 #define INPLACE_MULTIPLY 57
37057
f7fd11a75a6a INPLACE_DIVIDE is no longer necessary (INPLACE_TRUE_DIVIDE is used).
Neal Norwitz <nnorwitz@gmail.com>
parents: 37014
diff changeset
40
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
41 #define INPLACE_MODULO 59
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
42 #define STORE_SUBSCR 60
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
43 #define DELETE_SUBSCR 61
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
44
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
45 #define BINARY_LSHIFT 62
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
46 #define BINARY_RSHIFT 63
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
47 #define BINARY_AND 64
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
48 #define BINARY_XOR 65
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
49 #define BINARY_OR 66
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
50 #define INPLACE_POWER 67
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
51 #define GET_ITER 68
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
52 #define PRINT_EXPR 70
41226
19f7ff443718 Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents: 40894
diff changeset
53 #define LOAD_BUILD_CLASS 71
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
54 #define YIELD_FROM 72
40788
e9a6234b26af * Remove PRINT_ITEM(_TO), PRINT_NEWLINE(_TO) opcodes.
Georg Brandl <georg@python.org>
parents: 39782
diff changeset
55
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
56 #define INPLACE_LSHIFT 75
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
57 #define INPLACE_RSHIFT 76
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
58 #define INPLACE_AND 77
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
59 #define INPLACE_XOR 78
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
60 #define INPLACE_OR 79
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
61 #define BREAK_LOOP 80
36695
b6d2f6fd3e11 PEP 343 -- the with-statement.
Guido van Rossum <guido@python.org>
parents: 32395
diff changeset
62 #define WITH_CLEANUP 81
41226
19f7ff443718 Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents: 40894
diff changeset
63
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
64 #define RETURN_VALUE 83
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
65 #define IMPORT_STAR 84
43777
0d462d789b18 Merging the py3k-pep3137 branch back into the py3k branch.
Guido van Rossum <guido@python.org>
parents: 43100
diff changeset
66
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
67 #define YIELD_VALUE 86
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
68 #define POP_BLOCK 87
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
69 #define END_FINALLY 88
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
70 #define POP_EXCEPT 89
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
71
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
72 #define HAVE_ARGUMENT 90 /* Opcodes from here have an argument: */
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
73
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
74 #define STORE_NAME 90 /* Index in name list */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
75 #define DELETE_NAME 91 /* "" */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
76 #define UNPACK_SEQUENCE 92 /* Number of sequence items */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
77 #define FOR_ITER 93
41699
e16c8e5c5ca4 Merged revisions 55225-55227,55229-55269 via svnmerge from
Guido van Rossum <guido@python.org>
parents: 41464
diff changeset
78 #define UNPACK_EX 94 /* Num items before variable part +
e16c8e5c5ca4 Merged revisions 55225-55227,55229-55269 via svnmerge from
Guido van Rossum <guido@python.org>
parents: 41464
diff changeset
79 (Num items after variable part << 8) */
13930
4eaa463c031a Merge UNPACK_LIST and UNPACK_TUPLE into a single UNPACK_SEQUENCE, since they
Thomas Wouters <thomas@python.org>
parents: 13256
diff changeset
80
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
81 #define STORE_ATTR 95 /* Index in name list */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
82 #define DELETE_ATTR 96 /* "" */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
83 #define STORE_GLOBAL 97 /* "" */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
84 #define DELETE_GLOBAL 98 /* "" */
64439
725231211273 Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced
Antoine Pitrou <solipsis@pitrou.net>
parents: 63114
diff changeset
85
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
86 #define LOAD_CONST 100 /* Index in const list */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
87 #define LOAD_NAME 101 /* Index in name list */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
88 #define BUILD_TUPLE 102 /* Number of tuple items */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
89 #define BUILD_LIST 103 /* Number of list items */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
90 #define BUILD_SET 104 /* Number of set items */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
91 #define BUILD_MAP 105 /* Always zero for now */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
92 #define LOAD_ATTR 106 /* Index in name list */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
93 #define COMPARE_OP 107 /* Comparison operator */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
94 #define IMPORT_NAME 108 /* Index in name list */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
95 #define IMPORT_FROM 109 /* Index in name list */
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
96
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
97 #define JUMP_FORWARD 110 /* Number of bytes to skip */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
98 #define JUMP_IF_FALSE_OR_POP 111 /* Target byte offset from beginning of code */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
99 #define JUMP_IF_TRUE_OR_POP 112 /* "" */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
100 #define JUMP_ABSOLUTE 113 /* "" */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
101 #define POP_JUMP_IF_FALSE 114 /* "" */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
102 #define POP_JUMP_IF_TRUE 115 /* "" */
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
103
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
104 #define LOAD_GLOBAL 116 /* Index in name list */
178
fb6367d5ff46 Added opcodes to load local/global variables
Guido van Rossum <guido@python.org>
parents: 145
diff changeset
105
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
106 #define CONTINUE_LOOP 119 /* Start of loop (absolute) */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
107 #define SETUP_LOOP 120 /* Target address (relative) */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
108 #define SETUP_EXCEPT 121 /* "" */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
109 #define SETUP_FINALLY 122 /* "" */
69
cccd534f2280 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
110
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
111 #define LOAD_FAST 124 /* Local variable number */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
112 #define STORE_FAST 125 /* Local variable number */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
113 #define DELETE_FAST 126 /* Local variable number */
1262
f820e6917f07 Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
114
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
115 #define RAISE_VARARGS 130 /* Number of raise arguments (1, 2 or 3) */
12082
603db0d0aed1 slightly modified version of Greg Ewing's extended call syntax patch
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 8627
diff changeset
116 /* CALL_FUNCTION_XXX opcodes defined below depend on this definition */
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
117 #define CALL_FUNCTION 131 /* #args + (#kwargs<<8) */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
118 #define MAKE_FUNCTION 132 /* #defaults + #kwdefaults<<8 + #annotations<<16 */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
119 #define BUILD_SLICE 133 /* Number of items */
2803
a2363b6e9c86 new opcodes RAISE_VARARGS, CALL_FUNCTION
Guido van Rossum <guido@python.org>
parents: 2058
diff changeset
120
41226
19f7ff443718 Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents: 40894
diff changeset
121 #define MAKE_CLOSURE 134 /* same as MAKE_FUNCTION */
16257
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15939
diff changeset
122 #define LOAD_CLOSURE 135 /* Load free variable from closure */
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15939
diff changeset
123 #define LOAD_DEREF 136 /* Load and dereference from closure cell */
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15939
diff changeset
124 #define STORE_DEREF 137 /* Store into cell */
64620
25cc226dc9bd #4617: Previously it was illegal to delete a name from the local
Amaury Forgeot d'Arc <amauryfa@gmail.com>
parents: 64439
diff changeset
125 #define DELETE_DEREF 138 /* Delete closure cell */
16257
fd8c7203251f PEP 227 implementation
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 15939
diff changeset
126
12082
603db0d0aed1 slightly modified version of Greg Ewing's extended call syntax patch
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 8627
diff changeset
127 /* The next 3 opcodes must be contiguous and satisfy
12085
25b63367385e remove reference to CALL_FUNCTION_STAR in comment
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 12082
diff changeset
128 (CALL_FUNCTION_VAR - CALL_FUNCTION) & 3 == 1 */
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
129 #define CALL_FUNCTION_VAR 140 /* #args + (#kwargs<<8) */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
130 #define CALL_FUNCTION_KW 141 /* #args + (#kwargs<<8) */
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
131 #define CALL_FUNCTION_VAR_KW 142 /* #args + (#kwargs<<8) */
12082
603db0d0aed1 slightly modified version of Greg Ewing's extended call syntax patch
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 8627
diff changeset
132
54889
3aaf2e065db0 Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 51853
diff changeset
133 #define SETUP_WITH 143
3aaf2e065db0 Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 51853
diff changeset
134
14147
21ec69a56228 Charles G. Waldman <cgw@fnal.gov>:
Fred Drake <fdrake@acm.org>
parents: 14098
diff changeset
135 /* Support for opargs more than 16 bits long */
54889
3aaf2e065db0 Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 51853
diff changeset
136 #define EXTENDED_ARG 144
14147
21ec69a56228 Charles G. Waldman <cgw@fnal.gov>:
Fred Drake <fdrake@acm.org>
parents: 14098
diff changeset
137
50211
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 47594
diff changeset
138 #define LIST_APPEND 145
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 47594
diff changeset
139 #define SET_ADD 146
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 47594
diff changeset
140 #define MAP_ADD 147
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 47594
diff changeset
141
83572
cf65c7a75f55 check local class namespace before reaching for cells (closes #17853)
Benjamin Peterson <benjamin@python.org>
parents: 74356
diff changeset
142 #define LOAD_CLASSDEREF 148
21609
3ba0f1b20320 Patch #494783: Rename cmp_op enumerators.
Martin v. Löwis <martin@v.loewis.de>
parents: 19051
diff changeset
143
47594
212a1fee6bf9 #3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents: 44349
diff changeset
144 /* EXCEPT_HANDLER is a special, implicit block type which is created when
212a1fee6bf9 #3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents: 44349
diff changeset
145 entering an except handler. It is not an opcode but we define it here
212a1fee6bf9 #3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents: 44349
diff changeset
146 as we want it to be available to both frameobject.c and ceval.c, while
212a1fee6bf9 #3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents: 44349
diff changeset
147 remaining private.*/
212a1fee6bf9 #3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents: 44349
diff changeset
148 #define EXCEPT_HANDLER 257
212a1fee6bf9 #3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents: 44349
diff changeset
149
212a1fee6bf9 #3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents: 44349
diff changeset
150
21609
3ba0f1b20320 Patch #494783: Rename cmp_op enumerators.
Martin v. Löwis <martin@v.loewis.de>
parents: 19051
diff changeset
151 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,
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
152 PyCmp_IN, PyCmp_NOT_IN, PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD};
86
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents: 78
diff changeset
153
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents: 78
diff changeset
154 #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
155
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
156 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
157 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
158 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1288
diff changeset
159 #endif /* !Py_OPCODE_H */