Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ EmitCalli() [2/2]

virtual void System.Reflection.Emit.ILGenerator.EmitCalli ( OpCode opcode,
CallingConventions callingConvention,
Type? returnType,
Type?[] parameterTypes,
Type?[] optionalParameterTypes )
inlinevirtual

Definition at line 438 of file ILGenerator.cs.

439 {
440 int num = 0;
441 if (optionalParameterTypes != null && (callingConvention & CallingConventions.VarArgs) == 0)
442 {
443 throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention);
444 }
445 ModuleBuilder moduleBuilder = (ModuleBuilder)m_methodBuilder.Module;
446 SignatureHelper memberRefSignature = GetMemberRefSignature(callingConvention, returnType, parameterTypes, optionalParameterTypes);
448 Emit(OpCodes.Calli);
449 if (returnType != typeof(void))
450 {
451 num++;
452 }
453 if (parameterTypes != null)
454 {
455 num -= parameterTypes.Length;
456 }
457 if (optionalParameterTypes != null)
458 {
459 num -= optionalParameterTypes.Length;
460 }
461 if ((callingConvention & CallingConventions.HasThis) == CallingConventions.HasThis)
462 {
463 num--;
464 }
465 num--;
466 UpdateStackSize(OpCodes.Calli, num);
468 PutInteger4(moduleBuilder.GetSignatureToken(memberRefSignature));
469 }
void UpdateStackSize(OpCode opcode, int stackchange)
SignatureHelper GetMemberRefSignature(CallingConventions call, Type returnType, Type[] parameterTypes, Type[] optionalParameterTypes)

References System.Reflection.Emit.OpCodes.Calli, System.Reflection.Emit.ILGenerator.EnsureCapacity(), System.Reflection.Emit.ILGenerator.GetMemberRefSignature(), System.Reflection.Emit.ModuleBuilder.GetSignatureToken(), System.SR.InvalidOperation_NotAVarArgCallingConvention, System.Reflection.Emit.ILGenerator.m_methodBuilder, System.Reflection.MemberInfo.Module, System.Reflection.Emit.ILGenerator.PutInteger4(), System.Reflection.Emit.ILGenerator.RecordTokenFixup(), and System.Reflection.Emit.ILGenerator.UpdateStackSize().