OpCodes.Ldvirtftn 字段


将指向实现与指定对象关联的特定虚方法的本机代码的非托管指针(native int 类型)推送到计算堆栈上。Pushes an unmanaged pointer (type native int) to the native code implementing a particular virtual method associated with a specified object onto the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Ldvirtftn;
public static readonly System.Reflection.Emit.OpCode Ldvirtftn;
 staticval mutable Ldvirtftn : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ldvirtftn 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 07 < T >FE 07 < T > ldvirtftn methodldvirtftn method 将指针推送到对象的虚拟方法,@no__t 堆栈上的-0。Pushes the pointer to an object's virtual method method on the stack.

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

  1. 对象引用被推送到堆栈上。An object reference is pushed onto the stack.

  2. 从堆栈中弹出对象引用,并查找方法(由元数据标记 method)指定的入口点地址。The object reference is popped from the stack and the address of the entry point to the method (as specified by the metadata token method) is looked up.

  3. 指向 @no__t 的指针被推送到堆栈上。The pointer to method is pushed onto the stack.

如果在引用托管方法(或从托管代码转换为非托管代码的存根(stub))时,可以使用 Calli 指令将生成的非托管指针推送到 @no__t 堆栈上。The resulting unmanaged pointer pushed onto the stack by the ldvirtftn instruction 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 unmanaged pointer 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 ldvirtftn opcode:

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