KrkCallFrame Struct Reference

Represents a managed call state in a VM thread. More...

#include <vm.h>

Data Fields

KrkClosureclosure
 
uint8_t * ip
 
size_t slots
 
size_t outSlots
 
KrkTableglobals
 
KrkValue globalsOwner
 

Detailed Description

Represents a managed call state in a VM thread.

For every managed function call, including the top-level module, a call frame is added to the stack to track the running function, the current opcode instruction, the offset into the stack, and the valid globals table.

Call frames are used directly by the VM as the source of opcodes and operands during execution, and are used by the exception handler to roll back execution to the appropriate environment.

Definition at line 44 of file vm.h.

Field Documentation

◆ closure

KrkClosure* KrkCallFrame::closure

Pointer to the function object containing the code object for this frame

Definition at line 45 of file vm.h.

◆ globals

KrkTable* KrkCallFrame::globals

Pointer to the attribute table containing valud global vairables for this call

Definition at line 49 of file vm.h.

◆ globalsOwner

KrkValue KrkCallFrame::globalsOwner

Owner of the current globals context, to give to new closures.

Definition at line 50 of file vm.h.

◆ ip

uint8_t* KrkCallFrame::ip

Instruction pointer within the code object's bytecode data

Definition at line 46 of file vm.h.

◆ outSlots

size_t KrkCallFrame::outSlots

Offset into the stack at which stackTop will be reset upon return

Definition at line 48 of file vm.h.

◆ slots

size_t KrkCallFrame::slots

Offset into the stack at which this function call's arguments begin

Definition at line 47 of file vm.h.


The documentation for this struct was generated from the following file: