public static VM_t New(compiler.Bytecode bytecode) { Object.CompiledFunction mainFn = new Object.CompiledFunction { Instructions = bytecode.Instructions }; Object.Closure mainClosure = new Object.Closure { Fn = mainFn }; Frame_t mainFrame = Frame.NewFrame(mainClosure, 0); Frame_t[] frames = new Frame_t[MaxFrames]; frames[0] = mainFrame; return(new VM_t { constants = bytecode.Constants, stack = new List <Object.Object>(new Object.Object[StackSize]), sp = 0, globals = new List <Object.Object>(new Object.Object[GlobalSize]), frames = frames, frameIndex = 1, }); }
public static VM_t NewWithGlobalStore(compiler.Bytecode bytecode, ref List <Object.Object> s) { VM_t vm = New(bytecode); vm.globals = s; return(vm); }
public static void NewWithGlobalStore(compiler.Bytecode bytecode, ref List <Object.Object> s) { VM.New(bytecode); vm.globals = s; }