/// <summary> /// Emits a call or a virtual call to the varargs method. /// </summary> public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes) { Write("{0}\t{1}", opcode, methodInfo.FormatSignature()); base.EmitCall(opcode, methodInfo, optionalParameterTypes); }
private void EmitCall(Type objectType, MethodInfo method) { if (method.CallingConvention == CallingConventions.VarArgs) { throw Error.UnexpectedVarArgsCall(method.FormatSignature()); } OpCode callOp = UseVirtual(method) ? OpCodes.Callvirt : OpCodes.Call; if (callOp == OpCodes.Callvirt && objectType.IsValueType) { _ilg.Emit(OpCodes.Constrained, objectType); } _ilg.Emit(callOp, method); }
/// <summary> /// Emits an instruction with the metadata token for a specified method. /// </summary> public override void Emit(OpCode opcode, MethodInfo meth) { Write("{0}\t{1}", opcode, meth.FormatSignature()); base.Emit(opcode, meth); }