OpCodes.Ldftn 字段


将指向实现特定方法的本机代码的非托管指针(native int 类型)推送到计算堆栈上。Pushes an unmanaged pointer (type native int) to the native code implementing a specific method onto the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Ldftn;
public static readonly System.Reflection.Emit.OpCode Ldftn;
 staticval mutable Ldftn : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ldftn As OpCode 



下表列出了指令的十六进制和 Microsoft 中间语言(MSIL)程序集格式以及简短的参考摘要:The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

格式Format 程序集格式Assembly Format 说明Description
FE 06 < T >FE 06 < T > ldftn methodldftn method 将指针推送到堆栈上 method 所引用的方法。Pushes a pointer to a method referenced by method on the stack.

堆栈转换行为顺序如下:The stack transitional behavior, in sequential order, is:

  1. 指向特定方法的非托管指针将被推送到堆栈上。The unmanaged pointer to a specific method is pushed onto the stack.

如果特定方法(method)引用托管方法(或从托管代码转换为非托管代码的存根),则可以使用 Calli 指令调用此方法。The specific method (method) can be called using the Calli instruction if it references a managed method (or a stub that transitions from managed to unmanaged code).

返回的值指向使用 CLR 调用约定的本机代码。The value returned points to native code using the CLR calling convention. 此方法指针不应作为回调例程传递到非托管的本机代码。This method pointer should not be passed to unmanaged native code as a callback routine.

以下 @no__t 0 方法重载可以使用 @no__t 操作码:The following Emit method overload can use the ldftn opcode:

  • ILGenerator (操作码,MethodInfo)ILGenerator.Emit(OpCode, MethodInfo)