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

◆ Emit() [3/17]

virtual void System.Reflection.Emit.ILGenerator.Emit ( OpCode opcode,
ConstructorInfo con )
inlinevirtual

Reimplemented in System.Reflection.Emit.DynamicILGenerator.

Definition at line 562 of file ILGenerator.cs.

563 {
564 if (con == null)
565 {
566 throw new ArgumentNullException("con");
567 }
568 int num = 0;
569 int methodToken = GetMethodToken(con, null, useMethodDef: true);
571 InternalEmit(opcode);
572 if (opcode.StackBehaviourPush == StackBehaviour.Varpush)
573 {
574 num++;
575 }
576 if (opcode.StackBehaviourPop == StackBehaviour.Varpop)
577 {
578 Type[] parameterTypes = con.GetParameterTypes();
579 if (parameterTypes != null)
580 {
581 num -= parameterTypes.Length;
582 }
583 }
584 UpdateStackSize(opcode, num);
586 PutInteger4(methodToken);
587 }
void UpdateStackSize(OpCode opcode, int stackchange)
void InternalEmit(OpCode opcode)
int GetMethodToken(MethodBase method, Type[] optionalParameterTypes, bool useMethodDef)

References System.Reflection.Emit.ILGenerator.EnsureCapacity(), System.Reflection.Emit.ILGenerator.GetMethodToken(), System.Reflection.MethodBase.GetParameterTypes(), System.Reflection.Emit.ILGenerator.InternalEmit(), System.Reflection.Emit.ILGenerator.PutInteger4(), System.Reflection.Emit.ILGenerator.RecordTokenFixup(), System.Reflection.Emit.OpCode.StackBehaviourPop, System.Reflection.Emit.OpCode.StackBehaviourPush, and System.Reflection.Emit.ILGenerator.UpdateStackSize().