Lines Matching refs:opcode
7 Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
37 executed once each, from first to last, until a STOP opcode is reached.
43 literal immediately following the INT opcode in the pickle bytestream. Other
45 whatever object is left on the stack when the final STOP opcode is executed.
81 unpickling). "Opcode bloat" isn't so much a subtlety as a source of
87 For compatibility, the meaning of a pickle opcode never changes. Instead new
96 the older unpickler) opcode.
109 int as 4 bytes following the opcode, which is cheaper to unpickle than the
150 # Some pickle opcodes have an argument, following the opcode in the
154 # the opcode stream, immediately following an opcode.
160 # Represents the number of bytes consumed by a two-argument opcode where
794 generally don't embed the count of objects in the opcode,
795 or pull it off the stack. Instead the MARK opcode is used
809 the POP_MARK opcode changes the stack from
826 # symbolic name of opcode; a string
829 # the code used in a bytestream to represent the opcode; a
833 # If the opcode has an argument embedded in the byte string, an
837 # argument bytes. If the opcode doesn't have an argument embedded
841 # what the stack looks like before this opcode runs; a list
844 # what the stack looks like after this opcode runs; a list
847 # the protocol number in which this opcode was introduced; an int
850 # human-readable docs for this opcode; a string
921 box, directly as binary bytes (1 for the opcode and 4 for the integer).
1357 When an opcode using a variable number of stack objects is done,
1497 Two newline-terminated strings follow the GLOBAL opcode. The first is
1517 The opcode is named to remind of the __reduce__() method.
1527 opcode is followed by code to create setstate's argument, and then a
1528 BUILD opcode to apply __setstate__ to that argument.
1578 This is the protocol 0 version of protocol 1's OBJ opcode.
1580 module and class name, just as for the GLOBAL opcode (and see
1586 topmost markobject), just as for the TUPLE opcode.
1634 This is the protocol 1 version of protocol 0's INST opcode, and is
1641 Unlike INST, OBJ takes no arguments from the opcode stream. Instead
1684 For protocol 2 and above, a pickle must start with this opcode.
1696 Every pickle ends with this opcode. The object at the top of the stack
1729 of being a string embedded in the opcode bytestream). The persistent
1754 # Build a code2op dict, mapping opcode characters to OpcodeInfo records.
1770 print "skipping %r: it doesn't look like an opcode name" % name
1792 raise ValueError("pickle.py appears to have a pickle opcode with "
1805 # A pickle opcode generator.
1812 Each opcode in the pickle is generated, from the current pickle position,
1813 stopping after a STOP opcode is delivered. A triple is generated for
1814 each opcode:
1816 opcode, arg, pos
1818 opcode is an OpcodeInfo record, describing the current opcode.
1820 If the opcode has an argument embedded in the pickle, arg is its decoded
1821 value, as a Python object. If the opcode doesn't have an argument, arg
1825 before reading the current opcode. If the pickle is a string object,
1844 opcode = code2op.get(code)
1845 if opcode is None:
1849 raise ValueError("at position %s, opcode %r unknown" % (
1852 if opcode.arg is None:
1855 arg = opcode.arg.reader(pickle)
1856 yield opcode, arg, pos
1858 assert opcode.name == 'STOP'
1866 gets = set() # set of args used by a GET opcode
1868 prevpos = None # set to pos if previous opcode was a PUT
1869 for opcode, arg, pos in genops(p):
1873 if 'PUT' in opcode.name:
1875 elif 'GET' in opcode.name:
1896 the first STOP opcode encountered.
1912 + All embedded opcode arguments "make sense".
1916 + When an opcode implicitly refers to a markobject, a markobject is
1937 for opcode, arg, pos in genops(pickle):
1941 line = "%-4s %s%s" % (repr(opcode.code)[1:-1],
1943 opcode.name)
1945 maxproto = max(maxproto, opcode.proto)
1946 before = opcode.stack_before # don't mutate
1947 opcode.stack_after # don't mutate
1952 if markobject in before or (opcode.name == "POP" and
1962 markmsg = "(MARK at unknown opcode offset)"
1973 assert opcode.name == "POP"
1979 if opcode.name in ("PUT", "BINPUT", "LONG_BINPUT"):
1990 elif opcode.name in ("GET", "BINGET", "LONG_BINGET"):
1999 line += ' ' * (10 - len(opcode.name))
2007 # Note that we delayed complaining until the offending opcode
2177 has to emulate the stack in order to realize that the POP opcode at 16 gets