Concrete Python
git-339c971
|
#include <concrete/execution.hpp>
Classes | |
struct | Data |
Public Member Functions | |
Execution (const Execution &other) throw () | |
Execution () throw () | |
void | destroy () throw () |
bool | execute () |
ExecutionFrame | new_frame (const CodeObject &code, const DictObject &dict) |
template<typename Visitor > | |
void | visit (Visitor &v) const |
Static Public Member Functions | |
static Execution | New (const CodeObject &code) |
static Execution | New (const CodeObject &code, const DictObject &dict) |
static Execution | NewCall (const TupleObject &args) |
Protected Member Functions | |
Execution (unsigned int address) throw () | |
ExecutionFrame | frame () const |
CodeObject | code () const |
DictObject | dict () const |
void | initiate_call (const Object &callable, bool not_filter=false) |
void | initiate_call (const Object &callable, const TupleObject &args, bool not_filter=false) |
void | initiate_call (const Object &callable, const TupleObject &args, const DictObject &kwargs, bool not_filter=false) |
bool | resume_call () |
void | push (const Object &object) |
Object | peek () const |
Object | pop () |
void | execute_op () |
Static Protected Member Functions | |
static bool | Nonzero (Object object) |
Private Member Functions | |
Data * | data () const |
Executor for a function call stack. Implements a Python bytecode interpreter.
Execution | ( | unsigned int | address | ) | throw () [explicit, protected] |
Cast an Arena offset into a typed pointer.
Execution | ( | ) | throw () |
Type-specific null pointer.
CodeObject code | ( | ) | const [protected] |
Current function's code.
Execution::Data * data | ( | ) | const [private] |
Direct short-term access to Arena memory. Valid until the next memory allocation.
Reimplemented from ListNode< Execution >.
DictObject dict | ( | ) | const [protected] |
Current local variables.
bool execute | ( | ) |
Execute an instruction or resume a continuation.
void execute_op | ( | ) | [protected] |
Execute the next bytecode instruction.
ExecutionFrame frame | ( | ) | const [protected] |
Current frame.
void initiate_call | ( | const Object & | callable, |
bool | not_filter = false |
||
) | [protected] |
Start a Continuation.
callable | |
not_filter | causes the not-operator to be applied to the call's result before it's pushed on the stack |
void initiate_call | ( | const Object & | callable, |
const TupleObject & | args, | ||
bool | not_filter = false |
||
) | [protected] |
Start a Continuation.
callable | |
args | |
not_filter | causes the not-operator to be applied to the call's result before it's pushed on the stack |
void initiate_call | ( | const Object & | callable, |
const TupleObject & | args, | ||
const DictObject & | kwargs, | ||
bool | not_filter = false |
||
) | [protected] |
Start a Continuation.
callable | |
args | |
kwargs | |
not_filter | causes the not-operator to be applied to the call's result before it's pushed on the stack |
Execution New | ( | const CodeObject & | code | ) | [static] |
Create an executor for a Python module.
Execution New | ( | const CodeObject & | code, |
const DictObject & | dict | ||
) | [static] |
Create an executor for a Python function.
ExecutionFrame new_frame | ( | const CodeObject & | code, |
const DictObject & | dict | ||
) |
Set up a nested function call. Execution keeps a reference to the new frame until it's finished, but the caller must destroy it.
Execution NewCall | ( | const TupleObject & | args | ) | [static] |
Create an executor for a Python callable.
args | contains a CallableObject followed by its arguments |
Add an object at the top of the current frame's stack.
bool resume_call | ( | ) | [protected] |
Continue the current Continuation (if any).
void visit | ( | Visitor & | v | ) | const |
Visit all object references in the call stack.