Export (0) Print
Expand All

RuntimeHelpers.PrepareMethod Method (RuntimeMethodHandle)

Prepares a method for inclusion in a constrained execution region (CER).

Namespace:  System.Runtime.CompilerServices
Assembly:  mscorlib (in mscorlib.dll)

public static void PrepareMethod(
	RuntimeMethodHandle method
)

Parameters

method
Type: System.RuntimeMethodHandle

A handle to the method to prepare.

Compilers use the PrepareMethod(RuntimeMethodHandle) method to handle virtual calls that are made inside a constrained execution region (CER). At JIT compilation time, the common language runtime does not usually have enough information about the target of a virtual call. Therefore, the runtime does not initially prepare that segment of the call graph. If the code that is using the CER has enough knowledge to determine the target at any point in time before the CER is actually entered, it can call PrepareMethod(RuntimeMethodHandle) to perform the same runtime preparation normally done for a CER rooted at the method specified as an argument.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft