Ejemplo n.º 1
0
        private void PushToCallStack(DotMethodBase callee, List <object> arguments)
        {
            CheckFullCallStack();
            var newFrame = new StackFrame(CurrentStackFrame.CurrentMethod, callee)
            {
                Arguments = arguments
            };

            Runtime.CallStack.Push(newFrame);
        }
Ejemplo n.º 2
0
        private List <object> PopArgumentsFromStack(DotMethodBase method)
        {
            var args = new object[method.ParametersCount];

            for (int i = method.ParametersCount - 1; i >= 0; i--)
            {
                args[i] = PopFromStack();
            }
            return(new List <object>(args));
        }
Ejemplo n.º 3
0
        public void Execute(DotMethodBase method)
        {
            if (method.Body.Count == 0)
            {
                method.Execute(this);
            }
            else
            {
                Interpret(method.Body);
            }

            UnwindCallStack();
        }
Ejemplo n.º 4
0
 public StackFrame(DotMethodBase caller, DotMethodBase callee)
 {
     this.caller   = caller;
     currentMethod = callee;
 }