Search Results for

    Show / Hide Table of Contents

    Class CilPeepholeOptimizer

    A peephole optimizer for CIL instructions.

    Inheritance
    object
    PeepholeOptimizer<Instruction, ExceptionHandler>
    CilPeepholeOptimizer
    Inherited Members
    PeepholeOptimizer<Instruction, ExceptionHandler>.Rules
    PeepholeOptimizer<Instruction, ExceptionHandler>.Optimize(IReadOnlyList<Instruction>)
    PeepholeOptimizer<Instruction, ExceptionHandler>.Optimize(IReadOnlyList<Instruction>, IReadOnlyList<ExceptionHandler>, out IReadOnlyList<ExceptionHandler>)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Flame.Clr.Emit
    Assembly: Flame.Clr.dll
    Syntax
    public sealed class CilPeepholeOptimizer : PeepholeOptimizer<Instruction, ExceptionHandler>

    Fields

    | Edit this page View Source

    Instance

    An instance of the CIL peephole optimizer.

    Declaration
    public static readonly CilPeepholeOptimizer Instance
    Field Value
    Type Description
    CilPeepholeOptimizer

    Methods

    | Edit this page View Source

    GetBranchTargets(Instruction)

    Gets a list of all instructions to which a particular instruction may branch.

    Declaration
    protected override IEnumerable<Instruction> GetBranchTargets(Instruction instruction)
    Parameters
    Type Name Description
    Instruction instruction

    An instruction that may branch to other instructions.

    Returns
    Type Description
    IEnumerable<Instruction>

    A list of branch targets.

    Overrides
    PeepholeOptimizer<Instruction, ExceptionHandler>.GetBranchTargets(Instruction)
    | Edit this page View Source

    GetInstructionReferences(ExceptionHandler)

    Gets a list of all instructions referenced by a particular external instruction reference.

    Declaration
    protected override IEnumerable<Instruction> GetInstructionReferences(ExceptionHandler externalRef)
    Parameters
    Type Name Description
    ExceptionHandler externalRef

    The external reference to examine.

    Returns
    Type Description
    IEnumerable<Instruction>

    A list of referenced instructions.

    Overrides
    PeepholeOptimizer<Instruction, ExceptionHandler>.GetInstructionReferences(ExceptionHandler)
    | Edit this page View Source

    Optimize(MethodBody)

    Applies peephole optimizations to a CIL method body.

    Declaration
    public static void Optimize(MethodBody body)
    Parameters
    Type Name Description
    MethodBody body

    The method body to optimize.

    | Edit this page View Source

    RewriteBranchTargets(Instruction, IReadOnlyDictionary<Instruction, Instruction>)

    Rewrites an instruction's branch targets.

    Declaration
    protected override Instruction RewriteBranchTargets(Instruction instruction, IReadOnlyDictionary<Instruction, Instruction> branchTargetMap)
    Parameters
    Type Name Description
    Instruction instruction

    The instruction to rewrite.

    IReadOnlyDictionary<Instruction, Instruction> branchTargetMap

    A mapping of old branch target instructions to new branch target instructions.

    Returns
    Type Description
    Instruction

    A modified or new instruction.

    Overrides
    PeepholeOptimizer<Instruction, ExceptionHandler>.RewriteBranchTargets(Instruction, IReadOnlyDictionary<Instruction, Instruction>)
    | Edit this page View Source

    RewriteInstructionReferences(ExceptionHandler, IReadOnlyDictionary<Instruction, Instruction>)

    Rewrites an external reference's referenced instructions.

    Declaration
    protected override ExceptionHandler RewriteInstructionReferences(ExceptionHandler externalRef, IReadOnlyDictionary<Instruction, Instruction> referenceMap)
    Parameters
    Type Name Description
    ExceptionHandler externalRef

    The reference to rewrite.

    IReadOnlyDictionary<Instruction, Instruction> referenceMap

    A mapping of old referenced instructions to new referenced instructions.

    Returns
    Type Description
    ExceptionHandler

    A modified or new external reference.

    Overrides
    PeepholeOptimizer<Instruction, ExceptionHandler>.RewriteInstructionReferences(ExceptionHandler, IReadOnlyDictionary<Instruction, Instruction>)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX