Ejemplo n.º 1
0
        protected override void VisitCallMethod(CallMethod node, object data)
        {
            ParameterValues paramVals =
                state.Stack.Perform_CallMethod(node.Method, node.IsVirtCall);

            if (node.IsVirtCall)
            {
                paramVals.ChooseVirtualMethod();
            }

            Exception exc    = null;
            Value     retVal = null;

            if (holder.ContainsMethodBody(paramVals.Method))
            {
                retVal = InterpretMethod(holder, holder[paramVals.Method], paramVals, out exc, indent + "    ");
            }
            else
            {
                retVal = paramVals.Invoke(out exc);
            }

            if (exc == null)
            {
                if (retVal != null)
                {
                    state.Stack.Push(retVal);
                }
                AddTask(node.Next);
            }
            else
            {
                HandleException(node, exc);
            }
        }