Class OptimizationState
A container for shared optimization state.
Inheritance
Inherited Members
Namespace: Flame.Compiler.Pipeline
Assembly: Flame.Compiler.dll
Syntax
public sealed class OptimizationState
Constructors
| Improve this Doc View SourceOptimizationState(IMethod, Optimizer)
Creates optimization state for a method.
Declaration
public OptimizationState(IMethod method, Optimizer optimizer)
Parameters
Type | Name | Description |
---|---|---|
IMethod | method | The method to create the optimization state for. |
Optimizer | optimizer | The optimizer that is optimizing the method. |
Properties
| Improve this Doc View SourceMethod
Gets the method that is being optimized.
Declaration
public IMethod Method { get; }
Property Value
Type | Description |
---|---|
IMethod | A method. |
Optimizer
Gets the optimizer that triggered the optimization.
Declaration
public Optimizer Optimizer { get; }
Property Value
Type | Description |
---|---|
Optimizer | A method optimizer. |
Methods
| Improve this Doc View SourceGetBodiesAsync(IEnumerable<IMethod>)
Asynchronously requests a series of method bodies. The requests may execute concurrently.
Declaration
public Task<IReadOnlyDictionary<IMethod, MethodBody>> GetBodiesAsync(IEnumerable<IMethod> methods)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IMethod> | methods | The methods whose method bodies are requested. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<IMethod, MethodBody>> | A mapping of all unique methods in |
GetBodyAsync(IMethod)
Asynchronously requests a method's body.
Declaration
public Task<MethodBody> GetBodyAsync(IMethod method)
Parameters
Type | Name | Description |
---|---|---|
IMethod | method | The method whose body is requested. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MethodBody> | The method's body. |
Remarks
The optimizer is free to return any method body that is
semantically equivalent to method
's body.
This ranges from method
's initial method
body to its final optimized body.
Which version of method
's body is returned
depends on the optimizer. The optimizer is expected to return
a method body that is as optimized as possible given the
constraints imposed by the optimizer's implementation.