Mercurial > cpython-lru_cache-weakref
annotate Lib/opcode.py @ 74006:88198b93ff2f
Issue #13560: Add PyUnicode_EncodeLocale()
* Use PyUnicode_EncodeLocale() in time.strftime() if wcsftime() is not
available
* Document my last changes in Misc/NEWS
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Sat, 17 Dec 2011 04:13:41 +0100 |
| parents | d30b54ffd5e8 |
| children | d64ac9ab4cd0 |
| 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", |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
9 "HAVE_ARGUMENT", "EXTENDED_ARG"] |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
10 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
11 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
|
12 'is not', 'exception match', 'BAD') |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
13 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
14 hasconst = [] |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
15 hasname = [] |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
16 hasjrel = [] |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
17 hasjabs = [] |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
18 haslocal = [] |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
19 hascompare = [] |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
20 hasfree = [] |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
21 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
22 opmap = {} |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
23 opname = [''] * 256 |
|
31515
71a294bd7950
Replace backticks with repr() or "%r"
Walter Dörwald <walter@livinglogic.de>
parents:
28759
diff
changeset
|
24 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
|
25 del op |
|
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 def def_op(name, op): |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
28 opname[op] = name |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
29 opmap[name] = op |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
30 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
31 def name_op(name, op): |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
32 def_op(name, op) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
33 hasname.append(op) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
34 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
35 def jrel_op(name, op): |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
36 def_op(name, op) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
37 hasjrel.append(op) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
38 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
39 def jabs_op(name, op): |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
40 def_op(name, op) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
41 hasjabs.append(op) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
42 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
43 # Instruction opcodes for compiled code |
|
36695
b6d2f6fd3e11
PEP 343 -- the with-statement.
Guido van Rossum <guido@python.org>
parents:
32395
diff
changeset
|
44 # 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
|
45 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
46 def_op('POP_TOP', 1) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
47 def_op('ROT_TWO', 2) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
48 def_op('ROT_THREE', 3) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
49 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
|
50 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
|
51 |
|
32395
6bc6abba8659
Install two code generation optimizations that depend on NOP.
Raymond Hettinger <python@rcn.com>
parents:
31618
diff
changeset
|
52 def_op('NOP', 9) |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
53 def_op('UNARY_POSITIVE', 10) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
54 def_op('UNARY_NEGATIVE', 11) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
55 def_op('UNARY_NOT', 12) |
|
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 def_op('UNARY_INVERT', 15) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
58 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
59 def_op('BINARY_POWER', 19) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
60 def_op('BINARY_MULTIPLY', 20) |
|
37014
25007c155668
Get rid of last vestiges of BINARY_DIVIDE.
Neal Norwitz <nnorwitz@gmail.com>
parents:
36695
diff
changeset
|
61 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
62 def_op('BINARY_MODULO', 22) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
63 def_op('BINARY_ADD', 23) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
64 def_op('BINARY_SUBTRACT', 24) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
65 def_op('BINARY_SUBSCR', 25) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
66 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
|
67 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
|
68 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
|
69 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
|
70 |
|
44349
4dc01402d78a
Merged revisions 59541-59561 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
43100
diff
changeset
|
71 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
|
72 def_op('INPLACE_ADD', 55) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
73 def_op('INPLACE_SUBTRACT', 56) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
74 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
|
75 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
76 def_op('INPLACE_MODULO', 59) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
77 def_op('STORE_SUBSCR', 60) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
78 def_op('DELETE_SUBSCR', 61) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
79 def_op('BINARY_LSHIFT', 62) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
80 def_op('BINARY_RSHIFT', 63) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
81 def_op('BINARY_AND', 64) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
82 def_op('BINARY_XOR', 65) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
83 def_op('BINARY_OR', 66) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
84 def_op('INPLACE_POWER', 67) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
85 def_op('GET_ITER', 68) |
|
41226
19f7ff443718
Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents:
40894
diff
changeset
|
86 def_op('STORE_LOCALS', 69) |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
87 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
88 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
|
89 def_op('LOAD_BUILD_CLASS', 71) |
|
40788
e9a6234b26af
* Remove PRINT_ITEM(_TO), PRINT_NEWLINE(_TO) opcodes.
Georg Brandl <georg@python.org>
parents:
39782
diff
changeset
|
90 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
91 def_op('INPLACE_LSHIFT', 75) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
92 def_op('INPLACE_RSHIFT', 76) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
93 def_op('INPLACE_AND', 77) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
94 def_op('INPLACE_XOR', 78) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
95 def_op('INPLACE_OR', 79) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
96 def_op('BREAK_LOOP', 80) |
|
36695
b6d2f6fd3e11
PEP 343 -- the with-statement.
Guido van Rossum <guido@python.org>
parents:
32395
diff
changeset
|
97 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
|
98 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
99 def_op('RETURN_VALUE', 83) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
100 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
|
101 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
102 def_op('YIELD_VALUE', 86) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
103 def_op('POP_BLOCK', 87) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
104 def_op('END_FINALLY', 88) |
|
47594
212a1fee6bf9
#3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents:
45873
diff
changeset
|
105 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
|
106 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
107 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
|
108 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
109 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
|
110 name_op('DELETE_NAME', 91) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
111 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
|
112 jrel_op('FOR_ITER', 93) |
|
45873
bce69db72e00
Add missing UNPACK_EX opcode.
Thomas Wouters <thomas@python.org>
parents:
44349
diff
changeset
|
113 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
|
114 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
|
115 name_op('DELETE_ATTR', 96) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
116 name_op('STORE_GLOBAL', 97) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
117 name_op('DELETE_GLOBAL', 98) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
118 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
|
119 hasconst.append(100) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
120 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
|
121 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
|
122 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
|
123 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
|
124 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
|
125 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
|
126 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
|
127 hascompare.append(107) |
|
d0b83c4630c0
SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents:
39678
diff
changeset
|
128 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
|
129 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
|
130 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
131 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
|
132 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
|
133 jabs_op('JUMP_IF_TRUE_OR_POP', 112) # "" |
|
643d8d4fc8eb
http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents:
50211
diff
changeset
|
134 jabs_op('JUMP_ABSOLUTE', 113) # "" |
|
643d8d4fc8eb
http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents:
50211
diff
changeset
|
135 jabs_op('POP_JUMP_IF_FALSE', 114) # "" |
|
643d8d4fc8eb
http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents:
50211
diff
changeset
|
136 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
|
137 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
138 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
|
139 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
140 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
|
141 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
|
142 jrel_op('SETUP_EXCEPT', 121) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
143 jrel_op('SETUP_FINALLY', 122) # "" |
|
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 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
|
146 haslocal.append(124) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
147 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
|
148 haslocal.append(125) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
149 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
|
150 haslocal.append(126) |
|
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 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
|
153 def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
154 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
|
155 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
|
156 def_op('MAKE_CLOSURE', 134) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
157 def_op('LOAD_CLOSURE', 135) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
158 hasfree.append(135) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
159 def_op('LOAD_DEREF', 136) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
160 hasfree.append(136) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
161 def_op('STORE_DEREF', 137) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
162 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
|
163 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
|
164 hasfree.append(138) |
|
28091
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('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
167 def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
168 def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8) |
|
54889
3aaf2e065db0
Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
51853
diff
changeset
|
169 |
|
3aaf2e065db0
Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
51853
diff
changeset
|
170 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
|
171 |
|
50211
2ee4653927f7
Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
48546
diff
changeset
|
172 def_op('LIST_APPEND', 145) |
|
2ee4653927f7
Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
48546
diff
changeset
|
173 def_op('SET_ADD', 146) |
|
2ee4653927f7
Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
48546
diff
changeset
|
174 def_op('MAP_ADD', 147) |
|
2ee4653927f7
Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
48546
diff
changeset
|
175 |
|
54889
3aaf2e065db0
Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
51853
diff
changeset
|
176 def_op('EXTENDED_ARG', 144) |
|
3aaf2e065db0
Merged revisions 72912,72920,72940 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
51853
diff
changeset
|
177 EXTENDED_ARG = 144 |
|
50211
2ee4653927f7
Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
48546
diff
changeset
|
178 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
179 del def_op, name_op, jrel_op, jabs_op |
