Skip to content

MethodBodyExtensions Class

Extension methods for MethodBody.

C#
public static class MethodBodyExtensions

Inheritance object

CreateInformationalSnapshotJIT(MethodBody)

Section titled “CreateInformationalSnapshotJIT(MethodBody)”

Creates an IInformationalMethodBody snapshot of the provided MethodBody. This will evaluate instructions as accurately as possible to the JIT compiler, which means that unreachable instructions aren’t evaluated.

C#
public static IInformationalMethodBody CreateInformationalSnapshotJIT(this MethodBody body)

body MethodBody
The MethodBody to create an informational snapshot for.

IInformationalMethodBody
An IInformationalMethodBody.

CreateInformationalSnapshotEvaluateAll(MethodBody)

Section titled “CreateInformationalSnapshotEvaluateAll(MethodBody)”

Creates an IInformationalMethodBody snapshot of the provided MethodBody. This evaluates unreachable instructions which means this is not accurate for proper CIL analysis, but this can be useful when we want to estimate stack sizes of unreachable instructions.

C#
public static IInformationalMethodBody CreateInformationalSnapshotEvaluateAll(this MethodBody body)

body MethodBody
The MethodBody to create an informational snapshot for.

IInformationalMethodBody
An IInformationalMethodBody.