diff --git a/src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs b/src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs
index f0d25faacd7b29..87532bf64a0e90 100644
--- a/src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs
+++ b/src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs
@@ -6,26 +6,173 @@
namespace System.Reflection.Emit
{
+ ///
+ /// Provides support for alternative ways to generate the Microsoft intermediate language (MSIL) and metadata for a dynamic method, including methods for creating tokens and for inserting the code, exception handling, and local variable signature blobs.
+ ///
+ ///
+ /// For more information about this API, see Supplemental API remarks for DynamicILInfo.
+ ///
public sealed partial class DynamicILInfo
{
internal DynamicILInfo() { }
+ ///
+ /// Gets the dynamic method whose body is generated by the current instance.
+ ///
+ /// A object representing the dynamic method for which the current object is generating code.
+ ///
+ /// A object is always associated with a dynamic method. The purpose of the class is to provide another way of inserting the MSIL stream, exception handling, and local variable signature into a dynamic method, for developers who want to generate MSIL without using the class.
+ ///
public System.Reflection.Emit.DynamicMethod DynamicMethod { get { throw null; } }
+ ///
+ /// Gets a token, valid in the scope of the current , representing the signature for the associated dynamic method.
+ ///
+ /// An array that contains the signature.
+ /// A token that can be embedded in the metadata and the MSIL stream for the associated dynamic method.
+ ///
+ /// For information on signature blobs, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". For more information, see ECMA 335 Common Language Infrastructure (CLI).
+ ///
public int GetTokenFor(byte[] signature) { throw null; }
+ ///
+ /// Gets a token, valid in the scope of the current , representing a dynamic method to be called from the associated method.
+ ///
+ /// The dynamic method to call.
+ /// A token that can be embedded in the MSIL stream for the associated dynamic method, as the target of an MSIL instruction.
+ ///
+ /// The token returned by this method overload allows you to call a dynamic method from the dynamic method associated with the current object. To call the associated dynamic method recursively, pass the value of the property.
+ ///
public int GetTokenFor(System.Reflection.Emit.DynamicMethod method) { throw null; }
+ ///
+ /// Gets a token, valid in the scope of the current , representing a field to be accessed from the associated dynamic method.
+ ///
+ /// The field to be accessed.
+ /// A token that can be used as the operand of an MSIL instruction that accesses fields, in the scope of the current object.
+ ///
+ /// You must obtain a token for any field that will be accessed by the dynamic method associated with the current object. Use the Type.GetField method to get a for the field you want to access, then use the property to get the .
+ ///
public int GetTokenFor(System.RuntimeFieldHandle field) { throw null; }
+ ///
+ /// Gets a token, valid in the scope of the current , representing a field to be accessed from the associated dynamic method; the field is on the specified generic type.
+ ///
+ /// The field to be accessed.
+ /// The generic type the field belongs to.
+ /// A token that can be used as the operand of an MSIL instruction that accesses fields in the scope of the current object.
+ ///
+ /// You must obtain a token for any field that will be accessed by the dynamic method associated with the current object. Use the Type.GetField method to get a for the field you want to access, and then use the property to get the .
+ ///
public int GetTokenFor(System.RuntimeFieldHandle field, System.RuntimeTypeHandle contextType) { throw null; }
+ ///
+ /// Gets a token, valid in the scope of the current , representing a method to be accessed from the associated dynamic method.
+ ///
+ /// The method to be accessed.
+ /// A token that can be used as the operand of an MSIL instruction that accesses methods, such as or , in the scope of the current object.
+ ///
+ /// You must obtain a token for any method that will be accessed by the dynamic method associated with the current object. Use the Type.GetMethod method to get a for the method you want to access, and then use the property to get the .
+ ///
+ ///
+ /// For a method that belongs to a generic type, use the method overload and specify a for the generic type.
+ ///
+ ///
public int GetTokenFor(System.RuntimeMethodHandle method) { throw null; }
+ ///
+ /// Gets a token, valid in the scope of the current , representing a method on a generic type.
+ ///
+ /// The method.
+ /// The generic type the method belongs to.
+ /// A token that can be used as the operand of an MSIL instruction that accesses methods, such as or , in the scope of the current object.
+ ///
+ /// You must obtain a token for any method that will be called by the dynamic method associated with the current object. Use the Type.GetMethod method to get a for the method you want to call, and then use the property to get the .
+ ///
public int GetTokenFor(System.RuntimeMethodHandle method, System.RuntimeTypeHandle contextType) { throw null; }
+ ///
+ /// Gets a token, valid in the scope of the current , representing a type to be used in the associated dynamic method.
+ ///
+ /// The type to be used.
+ /// A token that can be used as the operand of an MSIL instruction that requires a type, in the scope of the current object.
+ ///
+ /// The token returned by this method overload allows you to define a local variable type, and emit MSIL to create an instance of a type in the dynamic method associated with the current object.
+ ///
+ /// To get a representing a type, use the property.
+ ///
public int GetTokenFor(System.RuntimeTypeHandle type) { throw null; }
+ ///
+ /// Gets a token, valid in the scope of the current , representing a string literal to be used in the associated dynamic method.
+ ///
+ /// The string to be used.
+ /// A token that can be used as the operand of an MSIL instruction that requires a string, in the scope of the current object.
public int GetTokenFor(string literal) { throw null; }
[System.CLSCompliantAttribute(false)]
+ ///
+ /// Sets the code body of the associated dynamic method.
+ ///
+ /// A pointer to a byte array containing the MSIL stream.
+ /// The number of bytes in the MSIL stream.
+ /// The maximum number of items on the operand stack when the method is executing.
+ ///
+ /// No validity checks are performed on the MSIL stream.
+ ///
+ /// Calling this method a second time replaces the first MSIL stream with the second.
+ ///
+ /// Generating your own metadata and MSIL requires familiarity with the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set." For more information, see ECMA 335 Common Language Infrastructure (CLI).
+ ///
+ /// is and is greater than 0.
+ /// is less than 0.
public unsafe void SetCode(byte* code, int codeSize, int maxStackSize) { }
+ ///
+ /// Sets the code body of the associated dynamic method.
+ ///
+ /// An array that contains the MSIL stream.
+ /// The maximum number of items on the operand stack when the method is executing.
+ ///
+ /// No validity checks are performed on the MSIL stream.
+ ///
+ /// Calling this method a second time replaces the first MSIL stream with the second.
+ ///
+ /// Generating your own metadata and MSIL requires familiarity with the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". For more information, see ECMA 335 Common Language Infrastructure (CLI).
+ ///
public void SetCode(byte[]? code, int maxStackSize) { }
[System.CLSCompliantAttribute(false)]
+ ///
+ /// Sets the exception metadata for the associated dynamic method.
+ ///
+ /// A pointer to a byte array containing the exception metadata.
+ /// The number of bytes of exception metadata.
+ ///
+ /// The exception metadata for a method defines the location and size of all `try`, `catch`, `finally`, filter, and fault blocks. For information on the layout of this metadata, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". For more information, see ECMA 335 Common Language Infrastructure (CLI).
+ ///
+ /// is and is greater than 0.
+ /// is less than 0.
public unsafe void SetExceptions(byte* exceptions, int exceptionsSize) { }
+ ///
+ /// Sets the exception metadata for the associated dynamic method.
+ ///
+ /// An array that contains the exception metadata.
+ ///
+ /// The exception metadata for a method defines the location and size of all `try`, `catch`, `finally`, filter, and fault blocks. For information on the layout of this metadata, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". For more information, see ECMA 335 Common Language Infrastructure (CLI).
+ ///
public void SetExceptions(byte[]? exceptions) { }
[System.CLSCompliantAttribute(false)]
+ ///
+ /// Sets the local variable signature that describes the layout of local variables for the associated dynamic method.
+ ///
+ /// An array that contains the layout of local variables for the associated .
+ /// The number of bytes in the signature.
+ ///
+ /// The local variable signature describes the layout of a method's local variables. To simplify construction of the local variable signature, use the ( in Visual Basic) SignatureHelper.GetLocalVarSigHelper method to get a for the local signature.
+ ///
+ /// For information on local variable signatures, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". For more information, see ECMA 335 Common Language Infrastructure (CLI).
+ ///
+ /// is and is greater than 0.
+ /// is less than 0.
public unsafe void SetLocalSignature(byte* localSignature, int signatureSize) { }
+ ///
+ /// Sets the local variable signature that describes the layout of local variables for the associated dynamic method.
+ ///
+ /// An array that contains the layout of local variables for the associated .
+ ///
+ /// The local variable signature describes the layout of a method's local variables. To simplify construction of the local variable signature, use the ( in Visual Basic) SignatureHelper.GetLocalVarSigHelper method to get a for the local signature.
+ ///
+ /// For information on local variable signatures, see the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". For more information, see ECMA 335 Common Language Infrastructure (CLI).
+ ///
public void SetLocalSignature(byte[]? localSignature) { }
}
public sealed partial class DynamicMethod : System.Reflection.MethodInfo