Search Results for

    Show / Hide Table of Contents

    Class OnDemandOptimizer

    An optimizer that computes optimized method bodies on an on-demand basis: method bodies are not optimized until they are requested. Optimized method bodies are cached, so method bodies are never optimized twice.

    Inheritance
    object
    Optimizer
    OnDemandOptimizer
    ParallelOnDemandOptimizer
    Inherited Members
    Optimizer.RunAllAsync<T>(IEnumerable<Func<Task<T>>>)
    Optimizer.RunAllAsync(IEnumerable<Func<Task>>)
    Optimizer.RunAllAsync(IEnumerable<Task>)
    Optimizer.RunAllAsync<T>(IEnumerable<Task<T>>)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Flame.Compiler.Pipeline
    Assembly: Flame.Compiler.dll
    Syntax
    public class OnDemandOptimizer : Optimizer

    Constructors

    | Edit this page View Source

    OnDemandOptimizer(IReadOnlyList<Optimization>)

    Creates a method body optimizer.

    Declaration
    public OnDemandOptimizer(IReadOnlyList<Optimization> pipeline)
    Parameters
    Type Name Description
    IReadOnlyList<Optimization> pipeline

    A pass pipeline: a sequence of optimizations to apply to every method body.

    | Edit this page View Source

    OnDemandOptimizer(IReadOnlyList<Optimization>, Func<IMethod, MethodBody>)

    Creates a method body optimizer.

    Declaration
    public OnDemandOptimizer(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.

    | Edit this page View Source

    OnDemandOptimizer(IReadOnlyList<Optimization>, Func<IMethod, MethodBody>, bool)

    Creates a method body optimizer.

    Declaration
    public OnDemandOptimizer(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 Source

    GetBodyAsync(IMethod)

    Asynchronously requests a method's body. This method should only used by external entities: if methods that are being optimized call this method, then they might cause a deadlock.

    Declaration
    public override Task<MethodBody> GetBodyAsync(IMethod requested)
    Parameters
    Type Name Description
    IMethod requested

    The method whose body is requested.

    Returns
    Type Description
    Task<MethodBody>

    The method's body.

    Overrides
    Optimizer.GetBodyAsync(IMethod)
    Remarks

    The optimizer is free to return any method body that is semantically equivalent to requested's body. This ranges from requested's initial method body to its final optimized body.

    Which version of requested'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.

    | Edit this page View Source

    GetBodyAsync(IMethod, IMethod)

    Asynchronously requests a method's body. This method will never cause a deadlock, even when methods cyclically request each other's method bodies.

    Declaration
    public override Task<MethodBody> GetBodyAsync(IMethod requested, IMethod requesting)
    Parameters
    Type Name Description
    IMethod requested

    The method whose body is requested.

    IMethod requesting

    The method that requests requested's method body.

    Returns
    Type Description
    Task<MethodBody>

    The method's body.

    Overrides
    Optimizer.GetBodyAsync(IMethod, IMethod)
    Remarks

    The optimizer is free to return any method body that is semantically equivalent to requested's body. This ranges from requested's initial method body to its final optimized body.

    Which version of requested'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.

    | Edit this page View Source

    GetInitialMethodBodyDefault(IMethod)

    Gets an initial method body for a method using the default mechanism of checking if the method is a body method and requesting its method body if so.

    Declaration
    public static MethodBody GetInitialMethodBodyDefault(IMethod method)
    Parameters
    Type Name Description
    IMethod method

    The recursive generic method declaration to inspect.

    Returns
    Type Description
    MethodBody

    A method body if one can be found; otherwise null.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX