frame.h File Reference

VM Frame. More...

Go to the source code of this file.

Classes

struct  PmBlock_s
struct  PmFrame_s
struct  PmNativeFrame_s

Defines

#define NATIVE_MAX_NUM_LOCALS   8

Typedefs

typedef enum PmBlockType_e PmBlockType_t
typedef enum PmBlockType_epPmBlockType_t
typedef struct PmBlock_s PmBlock_t
typedef struct PmBlock_spPmBlock_t
typedef struct PmFrame_s PmFrame_t
typedef struct PmFrame_spPmFrame_t
typedef struct PmNativeFrame_s PmNativeFrame_t
typedef struct PmNativeFrame_spPmNativeFrame_t

Enumerations

enum  PmBlockType_e { B_INVALID = 0, B_LOOP, B_TRY }

Functions

PmReturn_t frame_new (pPmObj_t pfunc, pPmObj_t *r_pobj)


Detailed Description

VM Frame.

VM frame header.


Define Documentation

#define NATIVE_MAX_NUM_LOCALS   8

The maximum number of local variables a native function can have. This defines the length of the locals array in the native frame struct.


Typedef Documentation

typedef struct PmBlock_s PmBlock_t

Block

Extra info for loops and trys (others?) Frames use linked list of blocks to handle nested loops and try-catch blocks.

Block Type

Numerical values to put in the 'b_type' field of the tPmBlockType struct.

typedef struct PmFrame_s PmFrame_t

Frame

A struct that holds the execution frame of a function, including the stack, local vars and pointer to the code object.

This struct doesn't declare the stack. frame_new() is responsible for allocating the extra memory at the tail of fo_locals[] to hold both the locals and stack.

Native Frame

A struct that holds the execution frame of a native function, including the args and single stack slot, and pointer to the code object.

This struct doesn't need an OD because it is only used statically in the globals struct. There's only one native frame, the global one. This happens because a native function is a leaf node in the call tree (a native func can't call python funcs).


Enumeration Type Documentation

Block Type

Numerical values to put in the 'b_type' field of the tPmBlockType struct.

Enumerator:
B_INVALID  Invalid block type
B_LOOP  Loop type
B_TRY  Try type


Function Documentation

PmReturn_t frame_new ( pPmObj_t  pfunc,
pPmObj_t r_pobj 
)

Allocate space for a new frame, fill its fields with respect to the given function object. Return pointer to the new frame.

Parameters:
pfunc ptr to Function object.
r_pobj Return value; the new frame.
Returns:
Return status.


Generated on Wed Feb 24 13:37:02 2010 for Python-on-a-chip by  doxygen 1.5.9