Concrete Python  git-339c971
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Private Member Functions
ExecutionFrame Class Reference

#include <concrete/execution.hpp>

+ Inheritance diagram for ExecutionFrame:
+ Collaboration diagram for ExecutionFrame:

List of all members.

Classes

struct  Block
struct  Data

Public Member Functions

 ExecutionFrame (const ExecutionFrame &other) throw ()
 ExecutionFrame () throw ()
void destroy () throw ()
Object result ()
template<typename Visitor >
void visit (Visitor &v) const

Protected Types

enum  { MaxBlocks }

Protected Member Functions

 ExecutionFrame (unsigned int address) throw ()
template<typename T >
load_bytecode ()
void jump_absolute (unsigned int target)
void jump_forward (unsigned int delta)
void push (const Object &object)
Object peek () const
Object pop ()
void push_block (unsigned int delta)
const Blockpeek_block () const
void pop_block ()

Static Protected Member Functions

static ExecutionFrame New (const ExecutionFrame &parent, const CodeObject &code, const DictObject &dict)

Private Member Functions

Datadata () const

Detailed Description

Function call state.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
MaxBlocks 

Maximum depth of the block stack (per frame).


Constructor & Destructor Documentation

ExecutionFrame ( unsigned int  address) throw () [explicit, protected]

Cast an Arena offset into a typed pointer.

ExecutionFrame ( const ExecutionFrame other) throw ()

Another reference.

ExecutionFrame ( ) throw ()

Type-specific null pointer.


Member Function Documentation

ExecutionFrame::Data * data ( ) const [private]

Direct short-term access to Arena memory. Valid until the next memory allocation.

void destroy ( ) throw ()

Delete Data and nullify the pointer.

void jump_absolute ( unsigned int  target) [protected]

Replace the current bytecode position.

void jump_forward ( unsigned int  delta) [protected]

Advance the current bytecode position.

T load_bytecode ( ) [protected]

Read from and advance the current bytecode position.

ExecutionFrame New ( const ExecutionFrame parent,
const CodeObject code,
const DictObject dict 
) [static, protected]

Create a frame. It's not yet attached to an executor.

Returns:
new reference owned by the caller
Object peek ( ) const [protected]

Refer to the object at the top of the object stack.

const ExecutionFrame::Block & peek_block ( ) const [protected]

Direct access to the Block at the top of the block stack.

Returns:
short-term reference to Arena memory
Object pop ( ) [protected]

Remove and return the object at the top of the object stack.

void pop_block ( ) [protected]

Remove the Block at the top of the block stack.

void push ( const Object object) [protected]

Add an object at the top of the object stack.

void push_block ( unsigned int  delta) [protected]

Add a Block referring to the current bytecode position at the top of the block stack.

Get the return value of a finished function call.

void visit ( Visitor &  v) const

Visit all object references in this and its parent frames.