Virtual Machine State
type VM_State = {
// Bytecode file to be executed
P: C0ByteCode,
// Constants the VM will use
C: VM_Constants,
// The callstack of the virtual machine
CallStack: VM_StackFrame[],
// The function frame that is currently executed
CurrFrame: VM_StackFrame,
// The line number of .bc0 file that is currently executing
CurrLineNumber: number,
// The type pool (struct type information) hashmap
TypeRecord: Map<string, Map<number, Struct_Type_Record>>
};P - The Byte Code to be Executed
P - The Byte Code to be Executedtype C0ByteCode = {
version: number;
/* Int Constant Pool */
intCount: number;
intPool: Int32Array;
/* String Constant Pool */
stringCount: number;
stringPool: Uint8Array;
/* Function Pool */
functionCount: number;
functionPool: C0Function[];
/* Native Functions */
nativeCount: number;
nativePool: (C0Native|undefined)[];
};C - Important Constants of Virtual Machine
C - Important Constants of Virtual MachineCurrFrame - The Function Frame currently Executing
CurrFrame - The Function Frame currently ExecutingCallStack - The Call Stack of Virtual Machine
CallStack - The Call Stack of Virtual MachineCurrLineNumber - Line Number of bc0 File VM is on
CurrLineNumber - Line Number of bc0 File VM is onTypeRecord - The Type information of Structs
TypeRecord - The Type information of StructsLast updated