OpCodes.Mkrefany Campo

Definição

Envia uma referência tipada a uma instância de um tipo específico para a pilha de avaliação.Pushes a typed reference to an instance of a specific type onto the evaluation stack.

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

Valor do campo

OpCode

Comentários

A tabela a seguir lista o formato de assembly hexadecimal e da MSIL (Microsoft Intermediate Language) da instrução, juntamente com um resumo de referência breve:The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

FormatarFormat Formato do assemblyAssembly Format DescriçãoDescription
C6 < T >C6 < T > mkrefany classmkrefany class Envia por push uma referência tipada do tipo class para a pilha.Pushes a typed reference of type class onto the stack.

O comportamento de transição de pilha, em ordem sequencial, é:The stack transitional behavior, in sequential order, is:

  1. Um ponteiro para a parte dos dados é enviado por push para a pilha.A pointer to piece of data is pushed onto the stack.

  2. O ponteiro é retirado e convertido em uma referência tipada do tipo class .The pointer is popped and converted to a typed reference of type class.

  3. A referência tipada é enviada por push para a pilha.The typed reference is pushed onto the stack.

A mkrefany instrução dá suporte à passagem de referências digitadas dinamicamente.The mkrefany instruction supports the passing of dynamically typed references. O ponteiro deve ser do tipo & , * ou native int , e manter o endereço válido de um pedaço de dados.The pointer must be of type &, *, or native int, and hold the valid address of a piece of data. Class é o token de classe que descreve o tipo dos dados referenciados pelo ponteiro.Class is the class token describing the type of the data referenced by the pointer. Mkrefany envia por push uma referência tipada na pilha, fornecendo um descritor opaco do ponteiro e o tipo class .Mkrefany pushes a typed reference on the stack, providing an opaque descriptor of the pointer and the type class.

A única operação válida permitida em uma referência tipada é passá-la para um método que requer uma referência tipada como um parâmetro.The only valid operation permitted upon a typed reference is to pass it to a method that requires a typed reference as a parameter. O receptor pode usar as Refanytype Refanyval instruções e para recuperar o tipo (classe) e o endereço, respectivamente.The callee can then use the Refanytype and Refanyval instructions to retrieve the type (class) and the address respectively.

TypeLoadException será gerado se class não puder ser encontrado.TypeLoadException is thrown if class cannot be found. Isso normalmente é detectado quando as instruções da MSIL (Microsoft Intermediate Language) são convertidas em código nativo em vez de em tempo de execução.This is typically detected when Microsoft Intermediate Language (MSIL) instructions are converted to native code rather than at runtime.

A sobrecarga do método a seguir Emit pode usar o mkrefany opcode:The following Emit method overload can use the mkrefany opcode:

Aplica-se a