Class ParallelOnDemandOptimizer
A variant of the on-demand method optimizer that runs batches of tasks in parallel rather than in sequence.
Inherited Members
Namespace: Flame.Compiler.Pipeline
Assembly: Flame.Compiler.dll
Syntax
public class ParallelOnDemandOptimizer : OnDemandOptimizer
Constructors
| Edit this page View SourceParallelOnDemandOptimizer(IReadOnlyList<Optimization>)
Creates a method body optimizer.
Declaration
public ParallelOnDemandOptimizer(IReadOnlyList<Optimization> pipeline)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<Optimization> | pipeline | A pass pipeline: a sequence of optimizations to apply to every method body. |
ParallelOnDemandOptimizer(IReadOnlyList<Optimization>, Func<IMethod, MethodBody>)
Creates a method body optimizer.
Declaration
public ParallelOnDemandOptimizer(IReadOnlyList<Optimization> pipeline, Func<IMethod, MethodBody> getInitialMethodBody)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<Optimization> | pipeline | A pass pipeline: a sequence of optimizations to apply to every method body. |
| Func<IMethod, MethodBody> | getInitialMethodBody | A delegate that tries to find an initial method body for a method. This initial method body is is the starting point for further optimizations, both interprocedural and intraprocedural. |
ParallelOnDemandOptimizer(IReadOnlyList<Optimization>, Func<IMethod, MethodBody>, bool)
Creates a method body optimizer.
Declaration
public ParallelOnDemandOptimizer(IReadOnlyList<Optimization> pipeline, Func<IMethod, MethodBody> getInitialMethodBody, bool validateAfterEachPass)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<Optimization> | pipeline | A pass pipeline: a sequence of optimizations to apply to every method body. |
| Func<IMethod, MethodBody> | getInitialMethodBody | A delegate that tries to find an initial method body for a method. This initial method body is is the starting point for further optimizations, both interprocedural and intraprocedural. |
| bool | validateAfterEachPass | Tells if method bodies should be validated after each pass in the optimization pipeline. |
Methods
| Edit this page View SourceRunAllAsync<T>(IEnumerable<Func<Task<T>>>)
Runs a sequence of tasks and combines their results. Whether these tasks are run in sequence or in parallel depends on the optimizer.
Declaration
public override Task<IReadOnlyList<T>> RunAllAsync<T>(IEnumerable<Func<Task<T>>> tasks)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Func<Task<T>>> | tasks | A sequence of tasks to run. |
Returns
| Type | Description |
|---|---|
| Task<IReadOnlyList<T>> | A single task that combines the results from all tasks. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of value returned by a task. |