Example #1
0
        public override void RenderIL_Load(ILCanvas canvas)
        {
            if (method.IsEffectivelyInstanceMethod() && caller != null)
            {
                caller.GetILImplicitCast(method.GetILMethodInvokationType())
                .RenderIL_Load(canvas);

                arguments.GetILImplicitCasts(method.GetEffectiveParameterTypes())
                .RenderIL_Load(canvas);

                if (method.IsTechnicallyInstanceMethod() && method.DeclaringType.IsReferenceType())
                {
                    canvas.Emit_Callvirt(method);
                }
                else
                {
                    canvas.Emit_Call(method);
                }
            }
            else
            {
                arguments.GetILImplicitCasts(method.GetTechnicalParameterTypes())
                .RenderIL_Load(canvas);

                canvas.Emit_Call(method);
            }
        }
Example #2
0
        public override void RenderIL_Load(ILCanvas canvas)
        {
            caller.RenderIL_Load(canvas);

            arguments.GetILImplicitCasts(constructor.GetEffectiveParameterTypes())
            .RenderIL_Load(canvas);

            canvas.Emit_Call(constructor);
        }
Example #3
0
        public override void RenderIL_Load(ILCanvas canvas)
        {
            if (targets.IsNotEmpty())
            {
                MethodInfo wrap_method = GetType().GetStaticMethod <object>("Wrap").GetNativeMethodInfo();
                MethodInfo join_method = GetType().GetStaticMethod <IEnumerable[]>("Join").GetNativeMethodInfo();

                join_method.GetStaticILMethodInvokation(
                    new ILNewPopulatedArray(
                        typeof(IEnumerable),
                        targets.Exchange(
                            v => v.GetValueType().IsTypicalIEnumerable() == false,
                            v => wrap_method.GetStaticILMethodInvokation(v)
                            )
                        )
                    ).RenderIL_Load(canvas);
            }
            else
            {
                canvas.Emit_Call(GetType().GetStaticMethod("None"));
            }
        }
Example #4
0
 public override void RenderIL_Load(ILCanvas canvas)
 {
     canvas.Emit_Ldtoken(constant);
     canvas.Emit_Call(typeof(Type).GetStaticMethod <RuntimeTypeHandle>("GetTypeFromHandle"));
 }
Example #5
0
        public override void EmitCast(ILCanvas canvas, ILValue value)
        {
            value.RenderIL_Load(canvas);

            canvas.Emit_Call(method);
        }