Lines Matching defs:opcodes
3 Extensive comments about the pickle protocols and pickle-machine opcodes
7 Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
29 # (== the highest .proto attr value among all the opcodes in the pickle).
39 # called an unpickling machine). It's a sequence of opcodes, interpreted by the
48 # Many opcodes push Python objects onto the stack; e.g., INT pushes a Python
51 # opcodes take Python objects off the stack. The result of unpickling is
57 # names. Some opcodes pop a stack object into the memo at a given index,
69 # point, and some sequences of pickle opcodes are subtle in order to
74 # types, like ints and tuples. They generally have opcodes dedicated to
81 # pickle opcodes never go away, not even when better ways to do a thing
83 # For example, protocol 0 had two opcodes for building Python integers (INT
95 # pickle opcodes get added, and each version's unpickler can handle all the
96 # pickle opcodes in all protocol versions to date. So old pickles continue to
98 # the subset of opcodes available under previous protocol versions too, so that
112 # "binary mode" before Python 2.3. This added many opcodes with arguments
118 # a number of opcodes that operate on many stack elements at once (like APPENDS
119 # and SETITEMS), and "shortcut" opcodes (like EMPTY_DICT and EMPTY_TUPLE).
132 # - Dedicated opcodes for bools (NEWTRUE, NEWFALSE).
157 # Some pickle opcodes have an argument, following the opcode in the
1067 some other opcodes grab all the objects from the top of
1091 # Descriptors for pickle opcodes.
1153 opcodes = [
1236 in Python) LONG1 and LONG4 opcodes.
1769 markobject is a unique object, used by other opcodes to identify a
2072 embedding the module and class names in INST opcodes.
2201 for i, d in enumerate(opcodes):
2220 for d in opcodes:
2257 msg = ["we appear to have pickle opcodes that pickle.py doesn't have:"]
2301 """Generate all the opcodes in a pickle.
2329 'Optimize a pickle string by removing unused PUT opcodes'
2334 opcodes = [] # (op, idx) or (pos, end_pos)
2340 opcodes.append((put, arg))
2344 opcodes.append((put, idx))
2351 opcodes.append((get, arg))
2358 opcodes.append((pos, end_pos))
2360 opcodes.append((pos, end_pos))
2363 # Copy the opcodes except for PUTS without a corresponding GET
2371 for op, arg in opcodes:
2406 may be mutated by dis(), if the pickle contains PUT or BINPUT opcodes.
2444 markstack = [] # bytecode positions of MARK opcodes
2545 print("highest protocol among opcodes =", maxproto, file=out)
2591 highest protocol among opcodes = 0
2625 highest protocol among opcodes = 1
2634 highest protocol among opcodes = 0
2666 highest protocol among opcodes = 0
2694 highest protocol among opcodes = 1
2719 highest protocol among opcodes = 0
2730 highest protocol among opcodes = 1
2750 highest protocol among opcodes = 0
2764 highest protocol among opcodes = 1
2777 highest protocol among opcodes = 2
2790 highest protocol among opcodes = 2
2805 highest protocol among opcodes = 2
2830 highest protocol among opcodes = 2
2835 highest protocol among opcodes = 2