class documentation
class TraceVM(vm.VirtualMachine): (source)
Special VM that remembers which instructions it executed.
Method | __init__ |
Construct a TypegraphVirtualMachine. |
Method | run |
Run a single bytecode instruction. |
Instance Variable | instructions |
Undocumented |
Instance Variable | _call |
Undocumented |
Instance Variable | _classes |
Undocumented |
Instance Variable | _functions |
Undocumented |
Instance Variable | _unknowns |
Undocumented |
Inherited from VirtualMachine
:
Exception |
|
Undocumented |
Method | binary |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the BEFORE_ASYNC_WITH opcode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Build a dictionary. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Call a function. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Pops top-of-stack and uses it to update the dict at stack[op.arg]. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the END_FINALLY opcode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the GET_AITER opcode. |
Method | byte_ |
Implementation of the GET_ANEXT opcode. |
Method | byte_ |
Implementation of the GET_AWAITABLE opcode. |
Method | byte_ |
Get the iterator for an object. |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the GET_YIELD_FROM_ITER opcode. |
Method | byte_ |
IMPORT_FROM is mostly like LOAD_ATTR but doesn't pop the container. |
Method | byte_ |
Import a single module. |
Method | byte_ |
Pops a module and stores all its contents in locals(). |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Pops top-of-stack and uses it to extend the list at stack[op.arg]. |
Method | byte_ |
Convert the list at the top of the stack to a tuple. |
Method | byte_ |
Undocumented |
Method | byte_ |
Pop an object, and retrieve a named attribute from it. |
Method | byte_ |
Undocumented |
Method | byte_ |
Retrieves a value out of either locals or a closure cell. |
Method | byte_ |
Retrieves a value out of a cell. |
Method | byte_ |
Undocumented |
Method | byte_ |
Retrieves a value out of a cell. |
Method | byte_ |
Load a local. Unlike LOAD_NAME, it doesn't fall back to globals. |
Method | byte_ |
Undocumented |
Method | byte_ |
Load a global variable, or fall back to trying to load a builtin. |
Method | byte_ |
Implementation of the LOAD_METHOD opcode. |
Method | byte_ |
Load a name. Can be a local, global, or builtin. |
Method | byte_ |
Undocumented |
Method | byte_ |
Make a function that binds local variables. |
Method | byte_ |
Create a function and push it onto the stack. |
Method | byte_ |
Implements the MAP_ADD opcode. |
Method | byte_ |
Implementation of the MATCH_CLASS opcode. |
Method | byte_ |
Implementation of the MATCH_KEYS opcode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implements POP_FINALLY. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Raise an exception. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Get and check the return value. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Sets up variable annotations in locals(). |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implements the SETUP_FINALLY opcode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Starts a 'with' statement. Will push a block. |
Method | byte_ |
Implementation of the STORE_ANNOTATION opcode. |
Method | byte_ |
Store an attribute. |
Method | byte_ |
Stores a value in a closure cell. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implement obj[subscr] = val. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Implement the UNARY_NOT bytecode. |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Undocumented |
Method | byte_ |
Called to finish cleaning up a with block. |
Method | byte_ |
Called to start cleaning up a with block. Calls the exit handlers etc. |
Method | byte_ |
Undocumented |
Method | byte_ |
Implementation of the YIELD_FROM opcode. |
Method | byte_ |
Yield a value from a generator. |
Method | call |
Pop arguments for a function and call it. |
Method | call |
Call a function with the given state. |
Method | call |
Undocumented |
Method | call |
Attempt to call the given function with made-up arguments. |
Method | compile |
Compile the given source code. |
Method | del |
Delete an attribute. |
Method | del |
Undocumented |
Method | expand |
Common functionality for 'is' and 'is not'. |
Method | flatten |
Undocumented |
Method | generate |
Undocumented |
Method | get |
Undocumented |
Method | get |
Get a real python dict of the globals. |
Method | get |
Get the python variable name corresponding to a Variable. |
Method | import |
Import a module and return the module object or None. |
Method | init |
Undocumented |
Method | inplace |
Undocumented |
Method | is |
Undocumented |
Method | is |
Check whether op is equivalent to a SETUP_EXCEPT opcode. |
Method | load |
Try loading an attribute, and report errors. |
Method | load |
Try loading an attribute, ignore errors. |
Method | load |
Undocumented |
Method | load |
Undocumented |
Method | load |
Load an item out of locals, globals, or builtins. |
Method | load |
Undocumented |
Method | load |
Called when a local is loaded onto the stack. |
Method | load |
Undocumented |
Method | make |
Create a new frame object, using the given args, globals and locals. |
Method | pop |
Undocumented |
Method | pop |
Retrieve a kwargs dictionary from the stack. Used by call_function. |
Method | pop |
Retrieve a varargs tuple from the stack. Used by call_function. |
Method | push |
Undocumented |
Method | push |
Undocumented |
Method | remaining |
Undocumented |
Method | resume |
Undocumented |
Method | run |
Run the given bytecode. |
Method | run |
Run a frame (typically belonging to a method). |
Method | run |
Run the code and return the CFG nodes. |
Method | set |
Undocumented |
Method | simple |
Get a stack of simple frames. |
Method | stack |
Get a frame stack for the given function for error reporting. |
Method | store |
Set an attribute on an object. |
Method | store |
Undocumented |
Method | store |
Called when a local is written. |
Method | store |
Undocumented |
Method | trace |
Fired whenever we call a builtin using unknown parameters. |
Method | trace |
Undocumented |
Method | trace |
Undocumented |
Method | trace |
Record trace data for other tools to use. |
Method | trace |
Fired whenever we create a variable containing 'Unknown'. |
Method | unary |
Undocumented |
Instance Variable | annotated |
Undocumented |
Instance Variable | ctx |
Undocumented |
Instance Variable | filename |
Undocumented |
Instance Variable | frame |
Undocumented |
Instance Variable | frames |
Undocumented |
Instance Variable | functions |
Undocumented |
Instance Variable | has |
Undocumented |
Instance Variable | late |
Undocumented |
Instance Variable | loaded |
Undocumented |
Instance Variable | local |
Undocumented |
Instance Variable | opcode |
Undocumented |
Property | current |
Undocumented |
Property | current |
Undocumented |
Property | current |
Undocumented |
Property | current |
Undocumented |
Method | _apply |
Applies the type annotation, if any, associated with this object. |
Method | _attribute |
Undocumented |
Method | _call |
Undocumented |
Method | _check |
Undocumented |
Method | _check |
Narrow the types of variables based on test assertions. |
Method | _cmp |
Implementation of CMP_IN/CMP_NOT_IN. |
Method | _cmp |
Checks if the comparison should always succeed. |
Method | _cmp |
Implementation of relational operators CMP_(LT|LE|EQ|NE|GE|GT). |
Method | _coerce |
Coerce the values in a variable to bools. |
Method | _compare |
Pops and compares the top two stack values and pushes a boolean. |
Method | _convert |
Undocumented |
Method | _data |
Undocumented |
Method | _del |
Called when a local or global is deleted. |
Method | _delete |
Undocumented |
Method | _filter |
Paste the bindings into var, filtering out false positives on None. |
Method | _get |
Get an async iterator from an object. |
Method | _get |
Get closure annotations and defaults from the stack. |
Method | _get |
Get function annotations and defaults from the stack. |
Method | _get |
Get an iterator from a sequence. |
Method | _get |
Helper function for _unpack_sequence. |
Method | _get |
Grabs the __annotations__ dict, if any, with the attribute type. |
Method | _has |
Whether the binding has any possible origins, with None filtering. |
Method | _import |
Import the module and return the module object. |
Method | _instantiate |
Instantiate an exception type. |
Method | _is |
True if var is the first arg of a class method in the current frame. |
Method | _is |
Undocumented |
Method | _load |
Undocumented |
Method | _maybe |
Check if a module path is in the overlay dictionary. |
Method | _name |
Returns a late annotation or returns Any and logs a name error. |
Method | _narrow |
Narrow a variable by removing bindings that do not satisfy pred. |
Method | _pop |
Pop a value off the stack and store it in a variable. |
Method | _process |
Process any type annotations in the named value. |
Method | _record |
Undocumented |
Method | _record |
Record a store_subscr to an __annotations__ dict. |
Method | _record |
Record a type annotation on a local variable. |
Method | _replace |
Replace unknowns added by push_abstract_exception with precise values. |
Method | _restructure |
Collapse the middle part of a tuple into a List variable. |
Method | _retrieve |
Load an attribute from an object. |
Method | _revert |
Undocumented |
Method | _set |
Undocumented |
Method | _set |
Undocumented |
Method | _setup |
Sets up an except block. |
Method | _store |
Assign a new var to a variable in locals. |
Method | _store |
Store 'value' under 'name'. |
Method | _suppress |
Undocumented |
Method | _unpack |
Pops a tuple (or other iterable) and pushes it onto the VM's stack. |
Method | _update |
Undocumented |
Method | _var |
Undocumented |
Method | _with |
Implements WITH_CLEANUP_START before Python 3.8. |
Method | _with |
Implements WITH_CLEANUP_START in Python 3.8+. |
Instance Variable | _analyzing |
Undocumented |
Instance Variable | _branch |
Undocumented |
Instance Variable | _director |
Undocumented |
Instance Variable | _importing |
Undocumented |
Instance Variable | _late |
Undocumented |
Instance Variable | _maximum |
Undocumented |
Instance Variable | _trace |
Undocumented |
Instance Variable | _var |
Undocumented |
overrides
pytype.vm.VirtualMachine.run_instruction
Run a single bytecode instruction. Args: op: An opcode. state: The state just before running this instruction. Returns: The state right after this instruction that should roll over to the subsequent instruction. If this opcode aborts this function (e.g. through a 'raise'), then the state's "why" attribute is set to the abort reason. Raises: VirtualMachineError: if a fatal error occurs.