Beispiel #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;
                }
            }
        }
Beispiel #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;
 }
Beispiel #3
0
 public static Action <A1, A2, A3> MakeVoidTyped <A1, A2, A3>(CallTarget3 f)
 {
     return((a1, a2, a3) => f(a1, a2, a3));
 }
Beispiel #4
0
 public static Func <A1, A2, A3, R> MakeTyped <A1, A2, A3, R>(CallTarget3 f)
 {
     return((a1, a2, a3) => Unbox <R>(f(a1, a2, a3)));
 }
 public Function3(PythonModule globals, string name, CallTarget3 target, string[] argNames, object[] defaults)
     : base(globals, name, argNames, defaults)
 {
     this.target = target;
 }
 public Function3(PythonModule globals, string name, CallTarget3 target, string[] argNames, object[] defaults)
     : base(globals, name, argNames, defaults)
 {
     this.target = target;
 }
Beispiel #7
0
 public OptimizedFunction3(OptimizedFunction3 from) : base(from)
 {
     target = from.target;
 }
Beispiel #8
0
 public OptimizedFunction3(string name, MethodInfo info, MethodBase[] targets, FunctionType functionType) : base(name, targets, functionType)
 {
     target = IronPython.Compiler.CodeGen.CreateDelegate(info, typeof(CallTarget3)) as CallTarget3;
 }
 public FastCallable3(string name, CallTarget3 target)
 {
     this.target3 = target;
     this.name = name;
 }