示例#1
0
        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);
            }
        }
示例#2
0
        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);
        }
示例#3
0
文件: Linker.cs 项目: sfuller/MonC
 public void AddFunctionBinding(string name, VMFunction enumerable, bool export)
 {
     _boundFunctions.Add(new BoundFunction {
         Name = name, Binding = enumerable, Exported = export
     });
 }