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_e * | pPmBlockType_t |
typedef struct PmBlock_s | PmBlock_t |
typedef struct PmBlock_s * | pPmBlock_t |
typedef struct PmFrame_s | PmFrame_t |
typedef struct PmFrame_s * | pPmFrame_t |
typedef struct PmNativeFrame_s | PmNativeFrame_t |
typedef struct PmNativeFrame_s * | pPmNativeFrame_t |
Enumerations | |
enum | PmBlockType_e { B_INVALID = 0, B_LOOP, B_TRY } |
Functions | |
PmReturn_t | frame_new (pPmObj_t pfunc, pPmObj_t *r_pobj) |
VM frame header.
#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.
Block
Extra info for loops and trys (others?) Frames use linked list of blocks to handle nested loops and try-catch blocks.
typedef enum PmBlockType_e PmBlockType_t |
Block Type
Numerical values to put in the 'b_type' field of the tPmBlockType struct.
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.
typedef struct PmNativeFrame_s PmNativeFrame_t |
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).
enum PmBlockType_e |
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.
pfunc | ptr to Function object. | |
r_pobj | Return value; the new frame. |