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

◆ EmitCalli() [3/4]

override void System.Reflection.Emit.DynamicILGenerator.EmitCalli ( OpCode opcode,
CallingConventions callingConvention,
Type returnType,
Type[] parameterTypes,
Type[] optionalParameterTypes )
inline

Definition at line 150 of file DynamicILGenerator.cs.

151 {
152 int num = 0;
153 if (optionalParameterTypes != null && (callingConvention & CallingConventions.VarArgs) == 0)
154 {
155 throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention);
156 }
157 SignatureHelper memberRefSignature = GetMemberRefSignature(callingConvention, returnType, parameterTypes, optionalParameterTypes);
159 Emit(OpCodes.Calli);
160 if (returnType != typeof(void))
161 {
162 num++;
163 }
164 if (parameterTypes != null)
165 {
166 num -= parameterTypes.Length;
167 }
168 if (optionalParameterTypes != null)
169 {
170 num -= optionalParameterTypes.Length;
171 }
172 if ((callingConvention & CallingConventions.HasThis) == CallingConventions.HasThis)
173 {
174 num--;
175 }
176 num--;
177 UpdateStackSize(OpCodes.Calli, num);
178 int tokenForSig = GetTokenForSig(memberRefSignature.GetSignature(appendEndOfSig: true));
179 PutInteger4(tokenForSig);
180 }
override SignatureHelper GetMemberRefSignature(CallingConventions call, Type returnType, Type[] parameterTypes, Type[][] requiredCustomModifiers, Type[][] optionalCustomModifiers, Type[] optionalParameterTypes)
void UpdateStackSize(OpCode opcode, int stackchange)

References System.Reflection.Emit.OpCodes.Calli, System.Reflection.Emit.ILGenerator.EnsureCapacity(), System.Reflection.Emit.DynamicILGenerator.GetMemberRefSignature(), System.Reflection.Emit.SignatureHelper.GetSignature(), System.Reflection.Emit.DynamicILGenerator.GetTokenForSig(), System.SR.InvalidOperation_NotAVarArgCallingConvention, System.Reflection.Emit.ILGenerator.PutInteger4(), and System.Reflection.Emit.ILGenerator.UpdateStackSize().