annotate Lib/opcode.py @ 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 5fe72b9ed48e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
1
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
2 """
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
3 opcode module - potentially shared between dis and other modules which
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
4 operate on bytecodes (e.g. peephole optimizers).
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
5 """
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
6
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
7 __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
8 "haslocal", "hascompare", "hasfree", "opname", "opmap",
77373
22dc0a433b0e Issue #11823: disassembly now shows argument counts on calls with keyword args
Alexander Belopolsky <alexander.belopolsky@gmail.com>
parents: 74356
diff changeset
9 "HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
10
87465
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
11 # It's a chicken-and-egg I'm afraid:
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
12 # We're imported before _opcode's made.
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
13 # With exception unheeded
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
14 # (stack_effect is not needed)
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
15 # Both our chickens and eggs are allayed.
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
16 # --Larry Hastings, 2013/11/23
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
17
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
18 try:
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
19 from _opcode import stack_effect
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
20 __all__.append('stack_effect')
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
21 except ImportError:
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
22 pass
5fe72b9ed48e Issue #19722: Added opcode.stack_effect(), which accurately
Larry Hastings <larry@hastings.org>
parents: 83791
diff changeset
23
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
24 cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is',
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
25 'is not', 'exception match', 'BAD')
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
26
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
27 hasconst = []
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
28 hasname = []
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
29 hasjrel = []
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
30 hasjabs = []
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
31 haslocal = []
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
32 hascompare = []
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
33 hasfree = []
77373
22dc0a433b0e Issue #11823: disassembly now shows argument counts on calls with keyword args
Alexander Belopolsky <alexander.belopolsky@gmail.com>
parents: 74356
diff changeset
34 hasnargs = []
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
35
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
36 opmap = {}
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
37 opname = [''] * 256
31515
71a294bd7950 Replace backticks with repr() or "%r"
Walter Dörwald <walter@livinglogic.de>
parents: 28759
diff changeset
38 for op in range(256): opname[op] = '<%r>' % (op,)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
39 del op
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
40
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
41 def def_op(name, op):
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
42 opname[op] = name
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
43 opmap[name] = op
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
44
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
45 def name_op(name, op):
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
46 def_op(name, op)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
47 hasname.append(op)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
48
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
49 def jrel_op(name, op):
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
50 def_op(name, op)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
51 hasjrel.append(op)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
52
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
53 def jabs_op(name, op):
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
54 def_op(name, op)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
55 hasjabs.append(op)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
56
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
57 # Instruction opcodes for compiled code
36695
b6d2f6fd3e11 PEP 343 -- the with-statement.
Guido van Rossum <guido@python.org>
parents: 32395
diff changeset
58 # Blank lines correspond to available opcodes
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
59
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
60 def_op('POP_TOP', 1)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
61 def_op('ROT_TWO', 2)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
62 def_op('ROT_THREE', 3)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
63 def_op('DUP_TOP', 4)
64439
725231211273 Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced
Antoine Pitrou <solipsis@pitrou.net>
parents: 54889
diff changeset
64 def_op('DUP_TOP_TWO', 5)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
65
32395
6bc6abba8659 Install two code generation optimizations that depend on NOP.
Raymond Hettinger <python@rcn.com>
parents: 31618
diff changeset
66 def_op('NOP', 9)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
67 def_op('UNARY_POSITIVE', 10)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
68 def_op('UNARY_NEGATIVE', 11)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
69 def_op('UNARY_NOT', 12)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
70
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
71 def_op('UNARY_INVERT', 15)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
72
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
73 def_op('BINARY_POWER', 19)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
74 def_op('BINARY_MULTIPLY', 20)
37014
25007c155668 Get rid of last vestiges of BINARY_DIVIDE.
Neal Norwitz <nnorwitz@gmail.com>
parents: 36695
diff changeset
75
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
76 def_op('BINARY_MODULO', 22)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
77 def_op('BINARY_ADD', 23)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
78 def_op('BINARY_SUBTRACT', 24)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
79 def_op('BINARY_SUBSCR', 25)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
80 def_op('BINARY_FLOOR_DIVIDE', 26)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
81 def_op('BINARY_TRUE_DIVIDE', 27)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
82 def_op('INPLACE_FLOOR_DIVIDE', 28)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
83 def_op('INPLACE_TRUE_DIVIDE', 29)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
84
44349
4dc01402d78a Merged revisions 59541-59561 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 43100
diff changeset
85 def_op('STORE_MAP', 54)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
86 def_op('INPLACE_ADD', 55)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
87 def_op('INPLACE_SUBTRACT', 56)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
88 def_op('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
89
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
90 def_op('INPLACE_MODULO', 59)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
91 def_op('STORE_SUBSCR', 60)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
92 def_op('DELETE_SUBSCR', 61)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
93 def_op('BINARY_LSHIFT', 62)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
94 def_op('BINARY_RSHIFT', 63)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
95 def_op('BINARY_AND', 64)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
96 def_op('BINARY_XOR', 65)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
97 def_op('BINARY_OR', 66)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
98 def_op('INPLACE_POWER', 67)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
99 def_op('GET_ITER', 68)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
100
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
101 def_op('PRINT_EXPR', 70)
41226
19f7ff443718 Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents: 40894
diff changeset
102 def_op('LOAD_BUILD_CLASS', 71)
74356
d64ac9ab4cd0 Implement PEP 380 - 'yield from' (closes #11682)
Nick Coghlan <ncoghlan@gmail.com>
parents: 71402
diff changeset
103 def_op('YIELD_FROM', 72)
40788
e9a6234b26af * Remove PRINT_ITEM(_TO), PRINT_NEWLINE(_TO) opcodes.
Georg Brandl <georg@python.org>
parents: 39782
diff changeset
104
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
105 def_op('INPLACE_LSHIFT', 75)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
106 def_op('INPLACE_RSHIFT', 76)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
107 def_op('INPLACE_AND', 77)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
108 def_op('INPLACE_XOR', 78)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
109 def_op('INPLACE_OR', 79)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
110 def_op('BREAK_LOOP', 80)
36695
b6d2f6fd3e11 PEP 343 -- the with-statement.
Guido van Rossum <guido@python.org>
parents: 32395
diff changeset
111 def_op('WITH_CLEANUP', 81)
41226
19f7ff443718 Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents: 40894
diff changeset
112
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
113 def_op('RETURN_VALUE', 83)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
114 def_op('IMPORT_STAR', 84)
48546
60535250a62c Remove MAKE_BYTES which is a leftover from the mutable byte literal time.
Georg Brandl <georg@python.org>
parents: 47594
diff changeset
115
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
116 def_op('YIELD_VALUE', 86)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
117 def_op('POP_BLOCK', 87)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
118 def_op('END_FINALLY', 88)
47594
212a1fee6bf9 #3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents: 45873
diff changeset
119 def_op('POP_EXCEPT', 89)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
120
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
121 HAVE_ARGUMENT = 90 # Opcodes from here have an argument:
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
122
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
123 name_op('STORE_NAME', 90) # Index in name list
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
124 name_op('DELETE_NAME', 91) # ""
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
125 def_op('UNPACK_SEQUENCE', 92) # Number of tuple items
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
126 jrel_op('FOR_ITER', 93)
45873
bce69db72e00 Add missing UNPACK_EX opcode.
Thomas Wouters <thomas@python.org>
parents: 44349
diff changeset
127 def_op('UNPACK_EX', 94)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
128 name_op('STORE_ATTR', 95) # Index in name list
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
129 name_op('DELETE_ATTR', 96) # ""
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
130 name_op('STORE_GLOBAL', 97) # ""
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
131 name_op('DELETE_GLOBAL', 98) # ""
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
132 def_op('LOAD_CONST', 100) # Index in const list
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
133 hasconst.append(100)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
134 name_op('LOAD_NAME', 101) # Index in name list
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
135 def_op('BUILD_TUPLE', 102) # Number of tuple items
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
136 def_op('BUILD_LIST', 103) # Number of list items
39693
d0b83c4630c0 SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents: 39678
diff changeset
137 def_op('BUILD_SET', 104) # Number of set items
44349
4dc01402d78a Merged revisions 59541-59561 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 43100
diff changeset
138 def_op('BUILD_MAP', 105) # Number of dict entries (upto 255)
39693
d0b83c4630c0 SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents: 39678
diff changeset
139 name_op('LOAD_ATTR', 106) # Index in name list
d0b83c4630c0 SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents: 39678
diff changeset
140 def_op('COMPARE_OP', 107) # Comparison operator
d0b83c4630c0 SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents: 39678
diff changeset
141 hascompare.append(107)
d0b83c4630c0 SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents: 39678
diff changeset
142 name_op('IMPORT_NAME', 108) # Index in name list
d0b83c4630c0 SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents: 39678
diff changeset
143 name_op('IMPORT_FROM', 109) # Index in name list
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
144
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
145 jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip
51853
643d8d4fc8eb http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents: 50211
diff changeset
146 jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code
643d8d4fc8eb http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents: 50211
diff changeset
147 jabs_op('JUMP_IF_TRUE_OR_POP', 112) # ""
643d8d4fc8eb http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents: 50211
diff changeset
148 jabs_op('JUMP_ABSOLUTE', 113) # ""
643d8d4fc8eb http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents: 50211
diff changeset
149 jabs_op('POP_JUMP_IF_FALSE', 114) # ""
643d8d4fc8eb http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents: 50211
diff changeset
150 jabs_op('POP_JUMP_IF_TRUE', 115) # ""
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
151
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
152 name_op('LOAD_GLOBAL', 116) # Index in name list
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
153
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
154 jabs_op('CONTINUE_LOOP', 119) # Target address
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
155 jrel_op('SETUP_LOOP', 120) # Distance to target address
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
156 jrel_op('SETUP_EXCEPT', 121) # ""
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
157 jrel_op('SETUP_FINALLY', 122) # ""
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
158
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
159 def_op('LOAD_FAST', 124) # Local variable number
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
160 haslocal.append(124)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
161 def_op('STORE_FAST', 125) # Local variable number
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
162 haslocal.append(125)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
163 def_op('DELETE_FAST', 126) # Local variable number
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
164 haslocal.append(126)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
165
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
166 def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
167 def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8)
77373
22dc0a433b0e Issue #11823: disassembly now shows argument counts on calls with keyword args
Alexander Belopolsky <alexander.belopolsky@gmail.com>
parents: 74356
diff changeset
168 hasnargs.append(131)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
169 def_op('MAKE_FUNCTION', 132) # Number of args with default values
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
170 def_op('BUILD_SLICE', 133) # Number of items
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
171 def_op('MAKE_CLOSURE', 134)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
172 def_op('LOAD_CLOSURE', 135)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
173 hasfree.append(135)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
174 def_op('LOAD_DEREF', 136)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
175 hasfree.append(136)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
176 def_op('STORE_DEREF', 137)
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
177 hasfree.append(137)
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
178 def_op('DELETE_DEREF', 138)
25cc226dc9bd #4617: Previously it was illegal to delete a name from the local
Amaury Forgeot d'Arc <amauryfa@gmail.com>
parents: 64439
diff changeset
179 hasfree.append(138)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
180
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
181 def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8)
77373
22dc0a433b0e Issue #11823: disassembly now shows argument counts on calls with keyword args
Alexander Belopolsky <alexander.belopolsky@gmail.com>
parents: 74356
diff changeset
182 hasnargs.append(140)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
183 def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8)
77373
22dc0a433b0e Issue #11823: disassembly now shows argument counts on calls with keyword args
Alexander Belopolsky <alexander.belopolsky@gmail.com>
parents: 74356
diff changeset
184 hasnargs.append(141)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
185 def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8)
77373
22dc0a433b0e Issue #11823: disassembly now shows argument counts on calls with keyword args
Alexander Belopolsky <alexander.belopolsky@gmail.com>
parents: 74356
diff changeset
186 hasnargs.append(142)
54889
3aaf2e065db0 Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 51853
diff changeset
187
3aaf2e065db0 Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 51853
diff changeset
188 jrel_op('SETUP_WITH', 143)
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
189
50211
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 48546
diff changeset
190 def_op('LIST_APPEND', 145)
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 48546
diff changeset
191 def_op('SET_ADD', 146)
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 48546
diff changeset
192 def_op('MAP_ADD', 147)
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 48546
diff changeset
193
83572
cf65c7a75f55 check local class namespace before reaching for cells (closes #17853)
Benjamin Peterson <benjamin@python.org>
parents: 77373
diff changeset
194 def_op('LOAD_CLASSDEREF', 148)
cf65c7a75f55 check local class namespace before reaching for cells (closes #17853)
Benjamin Peterson <benjamin@python.org>
parents: 77373
diff changeset
195 hasfree.append(148)
cf65c7a75f55 check local class namespace before reaching for cells (closes #17853)
Benjamin Peterson <benjamin@python.org>
parents: 77373
diff changeset
196
54889
3aaf2e065db0 Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 51853
diff changeset
197 def_op('EXTENDED_ARG', 144)
3aaf2e065db0 Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 51853
diff changeset
198 EXTENDED_ARG = 144
50211
2ee4653927f7 Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 48546
diff changeset
199
28091
04a93b7bdce4 new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff changeset
200 del def_op, name_op, jrel_op, jabs_op