示例#1
0
        public TR InvokeFunc3 <A1, A2, A3, TR> (object o, A1 a1, A2 a2, A3 a3)
        {
            Stats.Increment(StatsCounter.InvokeMemberBinderInvoked);

            bool invokeOnly = false;

            if (mOverloadState != OverloadState.HasOverload)
            {
                invokeOnly = UpdateInvoker(o);
                ICallerF <A1, A2, A3, TR> caller = mInvoker as ICallerF <A1, A2, A3, TR>;
                if (caller != null)
                {
                    Stats.Increment(StatsCounter.InvokeMemberBinderInvoked_Fast);

                    return(caller.Call(a1, a2, a3));                    // Fast path
                }
            }

            var args = mArgs;

            args[0] = (object)a1;
            args[1] = (object)a2;
            args[2] = (object)a3;
            return(ResolveAndInvoke <TR>(o, invokeOnly));
        }
示例#2
0
        public TR InvokeFunc8 <A1, A2, A3, A4, A5, A6, A7, A8, TR> (object o, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
        {
            Stats.Increment(StatsCounter.InvokeMemberBinderInvoked);

            bool invokeOnly = false;

            if (mOverloadState != OverloadState.HasOverload)
            {
                invokeOnly = UpdateInvoker(o);
                ICallerF <A1, A2, A3, A4, A5, A6, A7, A8, TR> caller = mInvoker as ICallerF <A1, A2, A3, A4, A5, A6, A7, A8, TR>;
                if (caller != null)
                {
                    Stats.Increment(StatsCounter.InvokeMemberBinderInvoked_Fast);

                    return(caller.Call(a1, a2, a3, a4, a5, a6, a7, a8));                        // Fast path
                }
            }

            var args = mArgs;

            args[0] = (object)a1;
            args[1] = (object)a2;
            args[2] = (object)a3;
            args[3] = (object)a4;
            args[4] = (object)a5;
            args[5] = (object)a6;
            args[6] = (object)a7;
            args[7] = (object)a8;
            return(ResolveAndInvoke <TR>(o, invokeOnly));
        }
示例#3
0
        public TR InvokeFunc0 <TR>(object o)
        {
            Stats.Increment(StatsCounter.InvokeMemberBinderInvoked);

            bool invokeOnly = false;

            if (mOverloadState != OverloadState.HasOverload)
            {
                invokeOnly = UpdateInvoker(o);
                ICallerF <TR> caller = mInvoker as ICallerF <TR>;
                if (caller != null)
                {
                    Stats.Increment(StatsCounter.InvokeMemberBinderInvoked_Fast);

                    return(caller.Call());                      // Fast path
                }
            }

            return(ResolveAndInvoke <TR>(o, invokeOnly));
        }