Class TailRecursionElimination
A transform that rewrites static calls to the current method just prior to a return as unconditional jumps to the entry point.
Inherited Members
Namespace: Flame.Compiler.Transforms
Assembly: Flame.Compiler.dll
Syntax
public sealed class TailRecursionElimination : Optimization
Fields
| Improve this Doc View SourceInstance
An instance of the tail recursion elimination optimization.
Declaration
public static readonly TailRecursionElimination Instance
Field Value
Type | Description |
---|---|
TailRecursionElimination | A tail recursion elimination optimization. |
Properties
| Improve this Doc View SourceIsCheckpoint
Tells if this optimization checkpoints its result. The optimizer takes care to always return the latest checkpointed method body is returned when a method's optimized method body is requested.
Declaration
public override bool IsCheckpoint { get; }
Property Value
Type | Description |
---|---|
System.Boolean | Tells if this optimization performs a checkpoint. |
Overrides
Methods
| Improve this Doc View SourceApply(FlowGraph, IMethod)
Applies the tail recursion elimination transform to a particular method.
Declaration
public FlowGraph Apply(FlowGraph graph, IMethod method)
Parameters
Type | Name | Description |
---|---|---|
FlowGraph | graph | A control-flow graph to optimize. |
IMethod | method | The method that has |
Returns
Type | Description |
---|---|
FlowGraph | An optimized control-flow graph. |
ApplyAsync(MethodBody, OptimizationState)
Applies the optimization to a method body.
Declaration
public override Task<MethodBody> ApplyAsync(MethodBody body, OptimizationState state)
Parameters
Type | Name | Description |
---|---|---|
MethodBody | body | A method body holder to optimize. |
OptimizationState | state | State associated with optimizations. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MethodBody> | A task that produces an optimized method body. |