Lines Matching refs:memo
9 dis(pickle, out=None, memo=None, indentlevel=4)
46 # The PM has two data areas, "the stack" and "the memo".
54 # The memo is simply an array of objects, or it can be implemented as a dict
55 # mapping little integers to objects. The memo serves as the PM's "long term
56 # memory", and the little integers indexing the memo are akin to variable
57 # names. Some opcodes pop a stack object into the memo at a given index,
58 # and others push a memo object at a given index onto the stack again.
135 # efficiently by index (EXT{1,2,4}). This is akin to the memo and GET, but
136 # the registry contents are predefined (there's nothing akin to the memo's
1796 doc="""Read an object from the memo and push it on the stack.
1798 The index of the memo object to push is given by the newline-terminated
1809 doc="""Read an object from the memo and push it on the stack.
1811 The index of the memo object to push is given by the 1-byte unsigned
1821 doc="""Read an object from the memo and push it on the stack.
1823 The index of the memo object to push is given by the 4-byte unsigned
1833 doc="""Store the stack top into the memo. The stack is not popped.
1835 The index of the memo location to write into is given by the newline-
1846 doc="""Store the stack top into the memo. The stack is not popped.
1848 The index of the memo location to write into is given by the 1-byte
1858 doc="""Store the stack top into the memo. The stack is not popped.
1860 The index of the memo location to write into is given by the 4-byte
1870 doc="""Store the stack top into the memo. The stack is not popped.
1872 The index of the memo location to write is the number of
1873 elements currently present in the memo.
2069 is taken off the stack, allowing it to be retrieved from the memo
2395 def dis(pickle, out=None, memo=None, indentlevel=4, annotate=0):
2405 Optional arg 'memo' is a Python dict, used as the pickle's memo. It
2407 Passing the same memo object to another dis() call then allows disassembly
2409 pickler with the same memo. Ordinarily you don't need to worry about this.
2429 + A memo entry isn't referenced before it's defined.
2431 + The markobject isn't stored in the memo.
2433 + A memo entry isn't redefined.
2441 if memo is None:
2442 memo = {} # crude emulation of unpickler memo
2489 # Check for correct memo usage.
2492 memo_idx = len(memo)
2497 if memo_idx in memo:
2498 errormsg = "memo key %r already defined" % arg
2500 errormsg = "stack is empty -- can't store into memo"
2502 errormsg = "can't store markobject in the memo"
2504 memo[memo_idx] = stack[-1]
2506 if arg in memo:
2508 after = [memo[arg]] # for better stack emulation
2510 errormsg = "memo key %r has never been stored into" % arg
2797 3: q BINPUT 0 Store the stack top into the memo. The stack is not popped.
2798 5: h BINGET 0 Read an object from the memo and push it on the stack.
2800 8: q BINPUT 1 Store the stack top into the memo. The stack is not popped.
2803 12: h BINGET 1 Read an object from the memo and push it on the stack.
2819 >>> memo = {}
2820 >>> dis(f, memo=memo)
2831 >>> dis(f, memo=memo)
2857 '-m', '--memo', action='store_true',
2858 help='preserve memo between disassemblies')
2886 memo = {} if args.memo else None
2890 dis(f, args.output, memo, args.indentlevel, annotate)