Class CilPeepholeOptimizer
A peephole optimizer for CIL instructions.
Inheritance
System.Object
CilPeepholeOptimizer
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Flame.Clr.Emit
Assembly: Flame.Clr.dll
Syntax
public sealed class CilPeepholeOptimizer : PeepholeOptimizer<Instruction, ExceptionHandler>
Fields
| Improve this Doc View SourceInstance
An instance of the CIL peephole optimizer.
Declaration
public static readonly CilPeepholeOptimizer Instance
Field Value
Type | Description |
---|---|
CilPeepholeOptimizer |
Methods
| Improve this Doc View SourceGetBranchTargets(Instruction)
Declaration
protected override IEnumerable<Instruction> GetBranchTargets(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.Cil.Instruction | instruction |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Mono.Cecil.Cil.Instruction> |
Overrides
Flame.Compiler.Target.PeepholeOptimizer<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.ExceptionHandler>.GetBranchTargets(Mono.Cecil.Cil.Instruction)
|
Improve this Doc
View Source
GetInstructionReferences(ExceptionHandler)
Declaration
protected override IEnumerable<Instruction> GetInstructionReferences(ExceptionHandler externalRef)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.Cil.ExceptionHandler | externalRef |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Mono.Cecil.Cil.Instruction> |
Overrides
Flame.Compiler.Target.PeepholeOptimizer<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.ExceptionHandler>.GetInstructionReferences(Mono.Cecil.Cil.ExceptionHandler)
|
Improve this Doc
View Source
Optimize(MethodBody)
Applies peephole optimizations to a CIL method body.
Declaration
public static void Optimize(MethodBody body)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.Cil.MethodBody | body | The method body to optimize. |
RewriteBranchTargets(Instruction, IReadOnlyDictionary<Instruction, Instruction>)
Declaration
protected override Instruction RewriteBranchTargets(Instruction instruction, IReadOnlyDictionary<Instruction, Instruction> branchTargetMap)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.Cil.Instruction | instruction | |
System.Collections.Generic.IReadOnlyDictionary<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.Instruction> | branchTargetMap |
Returns
Type | Description |
---|---|
Mono.Cecil.Cil.Instruction |
Overrides
Flame.Compiler.Target.PeepholeOptimizer<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.ExceptionHandler>.RewriteBranchTargets(Mono.Cecil.Cil.Instruction, System.Collections.Generic.IReadOnlyDictionary<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.Instruction>)
|
Improve this Doc
View Source
RewriteInstructionReferences(ExceptionHandler, IReadOnlyDictionary<Instruction, Instruction>)
Declaration
protected override ExceptionHandler RewriteInstructionReferences(ExceptionHandler externalRef, IReadOnlyDictionary<Instruction, Instruction> referenceMap)
Parameters
Type | Name | Description |
---|---|---|
Mono.Cecil.Cil.ExceptionHandler | externalRef | |
System.Collections.Generic.IReadOnlyDictionary<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.Instruction> | referenceMap |
Returns
Type | Description |
---|---|
Mono.Cecil.Cil.ExceptionHandler |
Overrides
Flame.Compiler.Target.PeepholeOptimizer<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.ExceptionHandler>.RewriteInstructionReferences(Mono.Cecil.Cil.ExceptionHandler, System.Collections.Generic.IReadOnlyDictionary<Mono.Cecil.Cil.Instruction, Mono.Cecil.Cil.Instruction>)