当前位置: 首页>>代码示例>>C#>>正文


C# EmitContext.EmitCall方法代码示例

本文整理汇总了C#中EmitContext.EmitCall方法的典型用法代码示例。如果您正苦于以下问题:C# EmitContext.EmitCall方法的具体用法?C# EmitContext.EmitCall怎么用?C# EmitContext.EmitCall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmitContext的用法示例。


在下文中一共展示了EmitContext.EmitCall方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EmitPropertyAccess

		void EmitPropertyAccess (EmitContext ec, PropertyInfo property)
		{
			var getter = property.GetGetMethod (true);
			if (!getter.IsStatic)
				ec.EmitLoadSubject (expression);

			ec.EmitCall (getter);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:MemberExpression.cs

示例2: EmitPropertyAccess

 private void EmitPropertyAccess(EmitContext emitContext, PropertyInfo property)
 {
     var getter = property.GetGetMethod(true);
     if (!getter.IsStatic)
     {
         emitContext.EmitLoadSubject(_expression);
     }
     emitContext.EmitCall(getter);
 }
开发者ID:qwertie,项目名称:Theraot,代码行数:9,代码来源:MemberExpression.net30.cs

示例3: EmitPropertyAssignment

		void EmitPropertyAssignment (EmitContext ec, PropertyInfo property, LocalBuilder local)
		{
			var setter = property.GetSetMethod (true);
			if (setter == null)
				throw new InvalidOperationException ();

			ec.EmitLoadSubject (local);
			expression.Emit (ec);
			ec.EmitCall (setter);
		}
开发者ID:rabink,项目名称:mono,代码行数:10,代码来源:MemberAssignment.cs

示例4: EmitLoadProperty

		LocalBuilder EmitLoadProperty (EmitContext ec, PropertyInfo property)
		{
			var getter = property.GetGetMethod (true);
			if (getter == null)
				throw new NotSupportedException ();

			var store = ec.ig.DeclareLocal (property.PropertyType);
			ec.EmitCall (getter);
			ec.ig.Emit (OpCodes.Stloc, store);
			return store;
		}
开发者ID:jishida,项目名称:BtrieveWrapper,代码行数:11,代码来源:MemberBinding.cs

示例5: EmitUserDefinedLiftedLogicalShortCircuit

		void EmitUserDefinedLiftedLogicalShortCircuit (EmitContext ec)
		{
			var ig = ec.ig;
			var and = NodeType == ExpressionType.AndAlso;

			var left_is_null = ig.DefineLabel ();
			var ret_left = ig.DefineLabel ();
			var ret_null = ig.DefineLabel ();
			var done = ig.DefineLabel ();

			var left = ec.EmitStored (this.left);

			ec.EmitNullableHasValue (left);
			ig.Emit (OpCodes.Brfalse, and ? ret_null : left_is_null);

			ec.EmitNullableGetValueOrDefault (left);
			ec.EmitCall (and ? GetFalseOperator () : GetTrueOperator ());
			ig.Emit (OpCodes.Brtrue, ret_left);

			ig.MarkLabel (left_is_null);
			var right = ec.EmitStored (this.right);
			ec.EmitNullableHasValue (right);
			ig.Emit (OpCodes.Brfalse, ret_null);

			ec.EmitNullableGetValueOrDefault (left);
			ec.EmitNullableGetValueOrDefault (right);
			ec.EmitCall (method);

			ec.EmitNullableNew (Type);
			ig.Emit (OpCodes.Br, done);

			ig.MarkLabel (ret_left);
			ec.EmitLoad (left);
			ig.Emit (OpCodes.Br, done);

			ig.MarkLabel (ret_null);
			var ret = ig.DeclareLocal (Type);
			ec.EmitNullableInitialize (ret);

			ig.MarkLabel (done);
		}
开发者ID:jskripsky,项目名称:mono,代码行数:41,代码来源:BinaryExpression.cs

示例6: EmitLiftedToNullUserDefinedOperator

		void EmitLiftedToNullUserDefinedOperator (EmitContext ec)
		{
			var ig = ec.ig;

			var ret = ig.DefineLabel ();
			var done = ig.DefineLabel ();

			var left = ec.EmitStored (this.left);
			var right = ec.EmitStored (this.right);

			ec.EmitNullableHasValue (left);
			ec.EmitNullableHasValue (right);
			ig.Emit (OpCodes.And);
			ig.Emit (OpCodes.Brfalse, ret);

			ec.EmitNullableGetValueOrDefault (left);
			ec.EmitNullableGetValueOrDefault (right);
			ec.EmitCall (method);
			ec.EmitNullableNew (Type);
			ig.Emit (OpCodes.Br, done);

			ig.MarkLabel (ret);
			var temp = ig.DeclareLocal (Type);
			ec.EmitNullableInitialize (temp);

			ig.MarkLabel (done);
		}
开发者ID:jskripsky,项目名称:mono,代码行数:27,代码来源:BinaryExpression.cs

示例7: EmitLiftedUserDefinedOperator

		void EmitLiftedUserDefinedOperator (EmitContext ec)
		{
			var ig = ec.ig;

			var ret_true = ig.DefineLabel ();
			var ret_false = ig.DefineLabel ();
			var done = ig.DefineLabel ();

			var left = ec.EmitStored (this.left);
			var right = ec.EmitStored (this.right);

			ec.EmitNullableHasValue (left);
			ec.EmitNullableHasValue (right);
			switch (NodeType) {
			case ExpressionType.Equal:
				ig.Emit (OpCodes.Bne_Un, ret_false);
				ec.EmitNullableHasValue (left);
				ig.Emit (OpCodes.Brfalse, ret_true);
				break;
			case ExpressionType.NotEqual:
				ig.Emit (OpCodes.Bne_Un, ret_true);
				ec.EmitNullableHasValue (left);
				ig.Emit (OpCodes.Brfalse, ret_false);
				break;
			default:
				ig.Emit (OpCodes.And);
				ig.Emit (OpCodes.Brfalse, ret_false);
				break;
			}

			ec.EmitNullableGetValueOrDefault (left);
			ec.EmitNullableGetValueOrDefault (right);
			ec.EmitCall (method);
			ig.Emit (OpCodes.Br, done);

			ig.MarkLabel (ret_true);
			ig.Emit (OpCodes.Ldc_I4_1);
			ig.Emit (OpCodes.Br, done);

			ig.MarkLabel (ret_false);
			ig.Emit (OpCodes.Ldc_I4_0);
			ig.Emit (OpCodes.Br, done);

			ig.MarkLabel (done);
		}
开发者ID:jskripsky,项目名称:mono,代码行数:45,代码来源:BinaryExpression.cs

示例8: EmitUserDefinedLogicalShortCircuit

		void EmitUserDefinedLogicalShortCircuit (EmitContext ec)
		{
			var ig = ec.ig;
			var and = NodeType == ExpressionType.AndAlso;

			var done = ig.DefineLabel ();

			var left = ec.EmitStored (this.left);

			ec.EmitLoad (left);
			ig.Emit (OpCodes.Dup);
			ec.EmitCall (and ? GetFalseOperator () : GetTrueOperator ());
			ig.Emit (OpCodes.Brtrue, done);

			ec.Emit (this.right);
			ec.EmitCall (method);

			ig.MarkLabel (done);
		}
开发者ID:jskripsky,项目名称:mono,代码行数:19,代码来源:BinaryExpression.cs

示例9: Emit

		internal override void Emit (EmitContext ec)
		{
			ec.EmitCall (obj, arguments, method);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:4,代码来源:MethodCallExpression.cs

示例10: Emit

 internal void Emit(EmitContext emitContext, LocalBuilder local)
 {
     emitContext.EmitCall(local, _arguments, _addMethod);
     EmitPopIfNeeded(emitContext);
 }
开发者ID:qwertie,项目名称:Theraot,代码行数:5,代码来源:ElementInit.net30.cs

示例11: EmitUserDefinedOperator

		void EmitUserDefinedOperator (EmitContext ec)
		{
			if (!IsLifted) {
				ec.Emit (operand);
				ec.EmitCall (method);
			} else if (IsLiftedToNull) {
				EmitUserDefinedLiftedToNullOperator (ec);
			} else
				EmitUserDefinedLiftedOperator (ec);
		}
开发者ID:qwertie,项目名称:Theraot,代码行数:10,代码来源:UnaryExpression.net30.cs

示例12: EmitUserDefinedLiftedOperator

		void EmitUserDefinedLiftedOperator (EmitContext ec)
		{
			var local = ec.EmitStored (operand);
			ec.EmitNullableGetValue (local);
			ec.EmitCall (method);
		}
开发者ID:qwertie,项目名称:Theraot,代码行数:6,代码来源:UnaryExpression.net30.cs

示例13: EmitConvertFromNullable

		void EmitConvertFromNullable (EmitContext ec)
		{
			if (IsBoxing ()) {
				ec.Emit (operand);
				EmitBox (ec);
				return;
			}

			ec.EmitCall (operand, operand.Type.GetMethod ("get_Value"));

			if (operand.Type.GetNotNullableType () != Type) {
				EmitPrimitiveConversion (ec,
					operand.Type.GetNotNullableType (),
					Type);
			}
		}
开发者ID:qwertie,项目名称:Theraot,代码行数:16,代码来源:UnaryExpression.net30.cs

示例14: Emit

		internal override void Emit (EmitContext ec)
		{
			ec.EmitCall (expression, arguments, expression.Type.GetInvokeMethod ());
		}
开发者ID:jishida,项目名称:BtrieveWrapper,代码行数:4,代码来源:InvocationExpression.cs

示例15: Emit

 internal override void Emit(EmitContext emitContext)
 {
     emitContext.EmitCall(_obj, _arguments, _method);
 }
开发者ID:qwertie,项目名称:Theraot,代码行数:4,代码来源:MethodCallExpression.net30.cs


注:本文中的EmitContext.EmitCall方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。