示例#1
0
        public OptimizedFunctionAny(string name, MethodInfo[] infos, MethodBase[] targets, FunctionType functionType) : base(name, targets, functionType)
        {
            for (int i = 0; i < infos.Length; i++)
            {
                Debug.Assert(infos[i].IsStatic);

                switch (infos[i].GetParameters().Length)
                {
                case 0: target0 = IronPython.Compiler.CodeGen.CreateDelegate(infos[i], typeof(CallTarget0)) as CallTarget0; break;

                case 1:
                    if (!infos[i].GetParameters()[0].ParameterType.HasElementType)
                    {
                        target1 = IronPython.Compiler.CodeGen.CreateDelegate(infos[i], typeof(CallTarget1)) as CallTarget1;
                    }
                    else
                    {
                        targetN = IronPython.Compiler.CodeGen.CreateDelegate(infos[i], typeof(CallTargetN)) as CallTargetN;
                    }
                    break;

                case 2: target2 = IronPython.Compiler.CodeGen.CreateDelegate(infos[i], typeof(CallTarget2)) as CallTarget2; break;

                case 3: target3 = IronPython.Compiler.CodeGen.CreateDelegate(infos[i], typeof(CallTarget3)) as CallTarget3; break;

                case 4: target4 = IronPython.Compiler.CodeGen.CreateDelegate(infos[i], typeof(CallTarget4)) as CallTarget4; break;

                case 5: target5 = IronPython.Compiler.CodeGen.CreateDelegate(infos[i], typeof(CallTarget5)) as CallTarget5; break;
                }
            }
        }
示例#2
0
 public OptimizedFunctionAny(OptimizedFunctionAny from) : base(from)
 {
     target0 = from.target0;
     target1 = from.target1;
     target2 = from.target2;
     target3 = from.target3;
     target4 = from.target4;
     target5 = from.target5;
     targetN = from.targetN;
 }
示例#3
0
 public static Action <A1, A2, A3, A4, A5> MakeVoidTyped <A1, A2, A3, A4, A5>(CallTarget5 f)
 {
     return((a1, a2, a3, a4, a5) => f(a1, a2, a3, a4, a5));
 }
示例#4
0
 public static Func <A1, A2, A3, A4, A5, R> MakeTyped <A1, A2, A3, A4, A5, R>(CallTarget5 f)
 {
     return((a1, a2, a3, a4, a5) => Unbox <R>(f(a1, a2, a3, a4, a5)));
 }
 public Function5(PythonModule globals, string name, CallTarget5 target, string[] argNames, object[] defaults)
     : base(globals, name, argNames, defaults)
 {
     this.target = target;
 }
 public Function5(PythonModule globals, string name, CallTarget5 target, string[] argNames, object[] defaults)
     : base(globals, name, argNames, defaults)
 {
     this.target = target;
 }
示例#7
0
 public OptimizedFunction5(OptimizedFunction5 from) : base(from)
 {
     target = from.target;
 }
示例#8
0
 public OptimizedFunction5(string name, MethodInfo info, MethodBase[] targets, FunctionType functionType) : base(name, targets, functionType)
 {
     target = IronPython.Compiler.CodeGen.CreateDelegate(info, typeof(CallTarget5)) as CallTarget5;
 }
 public FastCallable5(string name, CallTarget5 target)
 {
     this.target5 = target;
     this.name = name;
 }