private void GetFunctionStackSizes( VMModule module, int functionIndex, out int returnValueSize, out int argumentMemorySize, out int stackSize) { int definedFunctionCount = module.ILModule.DefinedFunctions.Length; if (functionIndex >= definedFunctionCount) { VMFunction function = module.VMFunctions[functionIndex]; returnValueSize = function.ReturnValueSize; argumentMemorySize = function.ArgumentMemorySize; stackSize = returnValueSize + argumentMemorySize; //frame = AcquireFrame(function.ArgumentMemorySize); //frame.BindingEnumerator = function.Delegate(this, new ArgumentSource(frame.Memory, 0)); } else { ILFunction function = module.ILModule.DefinedFunctions[functionIndex]; returnValueSize = function.ReturnValueSize; argumentMemorySize = function.ArgumentMemorySize; stackSize = function.MaxStackSize; //frame = AcquireFrame(function.MaxStackSize); } }
private bool InterpretBoundFunctionCall(StackFrame frame) { VMFunction boundFunction = frame.Module.VMFunctions[frame.Function]; boundFunction.Delegate(this, new ArgumentSource(frame.Memory, boundFunction.ReturnValueSize)); PopFrame(); // Return true to signify that we can break. return(true); }
public void AddFunctionBinding(string name, VMFunction enumerable, bool export) { _boundFunctions.Add(new BoundFunction { Name = name, Binding = enumerable, Exported = export }); }