Mercurial > cpython-lru_cache-weakref
annotate Lib/opcode.py @ 66978:aed2bbafa550 3.1
Blocked revisions 87324 via svnmerge
........
r87324 | r.david.murray | 2010-12-16 14:08:51 -0500 (Thu, 16 Dec 2010) | 9 lines
#10719: restore messages generated on invalid compileall args
Before the introduction of filename arguments to compileall it gave semi useful
messages about not being able to 'list' names that weren't valid directories.
This fix restores that behavior. In addition to the test for this case, the
patch also adds a test for the default behavior of compileall when no arguments
are provided, and fixes a bug in one of the previously added tests.
........
| author | R. David Murray <rdmurray@bitdance.com> |
|---|---|
| date | Thu, 16 Dec 2010 19:10:16 +0000 |
| parents | 643d8d4fc8eb |
| children | 3aaf2e065db0 |
| 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('STOP_CODE', 0) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
47 def_op('POP_TOP', 1) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
48 def_op('ROT_TWO', 2) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
49 def_op('ROT_THREE', 3) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
50 def_op('DUP_TOP', 4) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
51 def_op('ROT_FOUR', 5) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
52 |
|
32395
6bc6abba8659
Install two code generation optimizations that depend on NOP.
Raymond Hettinger <python@rcn.com>
parents:
31618
diff
changeset
|
53 def_op('NOP', 9) |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
54 def_op('UNARY_POSITIVE', 10) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
55 def_op('UNARY_NEGATIVE', 11) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
56 def_op('UNARY_NOT', 12) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
57 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
58 def_op('UNARY_INVERT', 15) |
|
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('BINARY_POWER', 19) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
61 def_op('BINARY_MULTIPLY', 20) |
|
37014
25007c155668
Get rid of last vestiges of BINARY_DIVIDE.
Neal Norwitz <nnorwitz@gmail.com>
parents:
36695
diff
changeset
|
62 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
63 def_op('BINARY_MODULO', 22) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
64 def_op('BINARY_ADD', 23) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
65 def_op('BINARY_SUBTRACT', 24) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
66 def_op('BINARY_SUBSCR', 25) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
67 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
|
68 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
|
69 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
|
70 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
|
71 |
|
44349
4dc01402d78a
Merged revisions 59541-59561 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
43100
diff
changeset
|
72 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
|
73 def_op('INPLACE_ADD', 55) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
74 def_op('INPLACE_SUBTRACT', 56) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
75 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
|
76 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
77 def_op('INPLACE_MODULO', 59) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
78 def_op('STORE_SUBSCR', 60) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
79 def_op('DELETE_SUBSCR', 61) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
80 def_op('BINARY_LSHIFT', 62) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
81 def_op('BINARY_RSHIFT', 63) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
82 def_op('BINARY_AND', 64) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
83 def_op('BINARY_XOR', 65) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
84 def_op('BINARY_OR', 66) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
85 def_op('INPLACE_POWER', 67) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
86 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
|
87 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
|
88 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
89 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
|
90 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
|
91 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
92 def_op('INPLACE_LSHIFT', 75) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
93 def_op('INPLACE_RSHIFT', 76) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
94 def_op('INPLACE_AND', 77) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
95 def_op('INPLACE_XOR', 78) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
96 def_op('INPLACE_OR', 79) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
97 def_op('BREAK_LOOP', 80) |
|
36695
b6d2f6fd3e11
PEP 343 -- the with-statement.
Guido van Rossum <guido@python.org>
parents:
32395
diff
changeset
|
98 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
|
99 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
100 def_op('RETURN_VALUE', 83) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
101 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
|
102 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
103 def_op('YIELD_VALUE', 86) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
104 def_op('POP_BLOCK', 87) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
105 def_op('END_FINALLY', 88) |
|
47594
212a1fee6bf9
#3021: Antoine Pitrou's Lexical exception handlers
Benjamin Peterson <benjamin@python.org>
parents:
45873
diff
changeset
|
106 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
|
107 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
108 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
|
109 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
110 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
|
111 name_op('DELETE_NAME', 91) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
112 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
|
113 jrel_op('FOR_ITER', 93) |
|
45873
bce69db72e00
Add missing UNPACK_EX opcode.
Thomas Wouters <thomas@python.org>
parents:
44349
diff
changeset
|
114 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
|
115 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
|
116 name_op('DELETE_ATTR', 96) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
117 name_op('STORE_GLOBAL', 97) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
118 name_op('DELETE_GLOBAL', 98) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
119 def_op('DUP_TOPX', 99) # number of items to duplicate |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
120 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
|
121 hasconst.append(100) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
122 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
|
123 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
|
124 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
|
125 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
|
126 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
|
127 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
|
128 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
|
129 hascompare.append(107) |
|
d0b83c4630c0
SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents:
39678
diff
changeset
|
130 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
|
131 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
|
132 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
133 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
|
134 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
|
135 jabs_op('JUMP_IF_TRUE_OR_POP', 112) # "" |
|
643d8d4fc8eb
http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents:
50211
diff
changeset
|
136 jabs_op('JUMP_ABSOLUTE', 113) # "" |
|
643d8d4fc8eb
http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents:
50211
diff
changeset
|
137 jabs_op('POP_JUMP_IF_FALSE', 114) # "" |
|
643d8d4fc8eb
http://bugs.python.org/issue4715
Jeffrey Yasskin <jyasskin@gmail.com>
parents:
50211
diff
changeset
|
138 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
|
139 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
140 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
|
141 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
142 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
|
143 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
|
144 jrel_op('SETUP_EXCEPT', 121) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
145 jrel_op('SETUP_FINALLY', 122) # "" |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
146 |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
147 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
|
148 haslocal.append(124) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
149 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
|
150 haslocal.append(125) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
151 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
|
152 haslocal.append(126) |
|
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 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
|
155 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
|
156 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
|
157 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
|
158 def_op('MAKE_CLOSURE', 134) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
159 def_op('LOAD_CLOSURE', 135) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
160 hasfree.append(135) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
161 def_op('LOAD_DEREF', 136) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
162 hasfree.append(136) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
163 def_op('STORE_DEREF', 137) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
164 hasfree.append(137) |
|
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) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
169 def_op('EXTENDED_ARG', 143) |
|
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
170 EXTENDED_ARG = 143 |
|
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 |
|
2ee4653927f7
Merged revisions 67818 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
48546
diff
changeset
|
176 |
|
28091
04a93b7bdce4
new opcode module - extract opcode definitions from dis.py - eventually
Skip Montanaro <skip@pobox.com>
parents:
diff
changeset
|
177 del def_op, name_op, jrel_op, jabs_op |
