System.Xml.Xsl.IlGen.GenerateHelper.CallToken C# (CSharp) Method

CallToken() public method

public CallToken ( MethodInfo meth ) : void
meth System.Reflection.MethodInfo
return void
        public void CallToken(MethodInfo meth)
        {
            Debug.Assert(!(_methInfo is ConstructorBuilder));
            MethodBuilder methBldr = _methInfo as MethodBuilder;

            if (methBldr != null)
            {
                // Using regular reflection emit, so get a token for the specified method.
                // The token is only valid within scope of this method's body.
                OpCode opcode = meth.IsVirtual || meth.IsAbstract ? OpCodes.Callvirt : OpCodes.Call;

                TraceCall(opcode, meth);

                this._ilgen.Emit(opcode, ((ModuleBuilder) methBldr.Module).MetadataToken);

                if (_lastSourceInfo != null)
                {
                    // Emit a "no source" sequence point, otherwise the debugger would return to the wrong line
                    // once the call has finished.  We are guaranteed not to emit adjacent sequence points because
                    // the Call instruction precedes this sequence point, and a nop instruction precedes other
                    // sequence points.
                    MarkSequencePoint(SourceLineInfo.NoSource);
                }
            }
            else
            {
                // Using LCG, so no need to workaround
                Call(meth);
            }
        }