EmitCallHelper() protected method

protected EmitCallHelper ( MethodBase mth, Operand target ) : void
mth System.Reflection.MethodBase
target Operand
return void
Example #1
0
        public override void EmitGet(CodeGen g)
        {
            if (getter == null)
            {
                base.EmitGet(g);
            }

            if (indexParameters.Count != 0)
            {
                throw new InvalidOperationException("Cannot access indexed property without indexes");
            }

            if (!IsStatic && (g.Context.IsStatic || g.Context.OwnerType != owner.TypeBuilder))
            {
                throw new InvalidOperationException("The property is accessed from an invalid context");
            }

            g.IL.Emit(OpCodes.Ldarg_0);
            g.EmitCallHelper(getter.GetMethodBuilder(), null);
        }
Example #2
0
        internal override void EmitGet(CodeGen g)
        {
            if (getter == null)
            {
                base.EmitGet(g);
            }

            if (indexParameters.Count != 0)
            {
                throw new InvalidOperationException(Properties.Messages.ErrMissingPropertyIndex);
            }

            if (!IsStatic && (g.Context.IsStatic || g.Context.OwnerType != owner.TypeBuilder))
            {
                throw new InvalidOperationException(Properties.Messages.ErrInvalidPropertyContext);
            }

            g.IL.Emit(OpCodes.Ldarg_0);
            g.EmitCallHelper(getter.GetMethodBuilder(), null);
        }
Example #3
0
        protected internal override void EmitGet(CodeGen g)
        {
            OperandExtensions.SetLeakedState(this, false);
            if (_getter == null)
            {
                base.EmitGet(g);
            }

            if (_indexParameters.Count != 0)
            {
                throw new InvalidOperationException(Properties.Messages.ErrMissingPropertyIndex);
            }

            if (!IsStatic && (g.Context.IsStatic || g.Context.OwnerType != _owner.TypeBuilder))
            {
                throw new InvalidOperationException(Properties.Messages.ErrInvalidPropertyContext);
            }

            g.IL.Emit(OpCodes.Ldarg_0);
            g.EmitCallHelper(_getter.GetMethodBuilder(), null);
        }
Example #4
0
        internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
        {
            if (_setter == null)
            {
                base.EmitSet(g, value, allowExplicitConversion);
            }

            if (_indexParameters.Count != 0)
            {
                throw new InvalidOperationException(Messages.ErrMissingPropertyIndex);
            }

            if (!IsStatic && (g.Context.IsStatic || g.Context.OwnerType != _owner.TypeBuilder))
            {
                throw new InvalidOperationException(Messages.ErrInvalidPropertyContext);
            }

            g.IL.Emit(OpCodes.Ldarg_0);
            g.EmitGetHelper(value, GetReturnType(TypeMapper), allowExplicitConversion);
            g.EmitCallHelper(_setter.GetMethodBuilder(), null);
        }
Example #5
0
        internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
        {
            if (setter == null)
                base.EmitSet(g, value, allowExplicitConversion);

            if (indexParameters.Count != 0)
                throw new InvalidOperationException(Properties.Messages.ErrMissingPropertyIndex);

            if (!IsStatic && (g.Context.IsStatic || g.Context.OwnerType != owner.TypeBuilder))
                throw new InvalidOperationException(Properties.Messages.ErrInvalidPropertyContext);

            g.IL.Emit(OpCodes.Ldarg_0);
            g.EmitGetHelper(value, Type, allowExplicitConversion);
            g.EmitCallHelper(setter.GetMethodBuilder(), null);
        }
Example #6
0
		protected internal override void EmitSet(CodeGen g, Operand value, bool allowExplicitConversion)
		{
		    OperandExtensions.SetLeakedState(this, false);  
			if (_setter == null)
				base.EmitSet(g, value, allowExplicitConversion);

			if (_indexParameters.Count != 0)
				throw new InvalidOperationException(Properties.Messages.ErrMissingPropertyIndex);

			if (!IsStatic && (g.Context.IsStatic || g.Context.OwnerType != _owner.TypeBuilder))
				throw new InvalidOperationException(Properties.Messages.ErrInvalidPropertyContext);

			g.IL.Emit(OpCodes.Ldarg_0);
			g.EmitGetHelper(value, GetReturnType(TypeMapper), allowExplicitConversion);
			g.EmitCallHelper(_setter.GetMethodBuilder(), null);
		}