示例#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> MakeVoidTyped <A1, A2, A3, A4>(CallTarget4 f)
 {
     return((a1, a2, a3, a4) => f(a1, a2, a3, a4));
 }
示例#4
0
 public static Func <A1, A2, A3, A4, R> MakeTyped <A1, A2, A3, A4, R>(CallTarget4 f)
 {
     return((a1, a2, a3, a4) => Unbox <R>(f(a1, a2, a3, a4)));
 }
 public Function4(PythonModule globals, string name, CallTarget4 target, string[] argNames, object[] defaults)
     : base(globals, name, argNames, defaults)
 {
     this.target = target;
 }
 public Function4(PythonModule globals, string name, CallTarget4 target, string[] argNames, object[] defaults)
     : base(globals, name, argNames, defaults)
 {
     this.target = target;
 }
示例#7
0
 public OptimizedFunction4(OptimizedFunction4 from) : base(from)
 {
     target = from.target;
 }
示例#8
0
 public OptimizedFunction4(string name, MethodInfo info, MethodBase[] targets, FunctionType functionType) : base(name, targets, functionType)
 {
     target = IronPython.Compiler.CodeGen.CreateDelegate(info, typeof(CallTarget4)) as CallTarget4;
 }
 public FastCallable4(string name, CallTarget4 target)
 {
     this.target4 = target;
     this.name = name;
 }