Show / Hide Table of Contents

    Interface IStackInstructionSelector<TInstruction>

    An instruction selector for a stack machine that can transfer data using either stack slots or register loads and stores.

    Inherited Members
    IInstructionSelector<TInstruction>.SelectInstructions(NamedInstruction)
    Namespace: Flame.Compiler.Target
    Assembly: Flame.Compiler.dll
    Syntax
    public interface IStackInstructionSelector<TInstruction> : IInstructionSelector<TInstruction>
    Type Parameters
    Name Description
    TInstruction

    The type of instructions to produce.

    Methods

    | Improve this Doc View Source

    CreateLoadRegister(ValueTag, IType)

    Creates instructions that load a value from its virtual register.

    Declaration
    IReadOnlyList<TInstruction> CreateLoadRegister(ValueTag value, IType type)
    Parameters
    Type Name Description
    ValueTag value

    The value to load.

    IType type

    The type of value.

    Returns
    Type Description
    System.Collections.Generic.IReadOnlyList<TInstruction>

    A list of selected instructions.

    | Improve this Doc View Source

    CreatePop(IType)

    Creates instructions that pop a value from the stack, discarding it.

    Declaration
    IReadOnlyList<TInstruction> CreatePop(IType type)
    Parameters
    Type Name Description
    IType type

    The type of value to pop.

    Returns
    Type Description
    System.Collections.Generic.IReadOnlyList<TInstruction>

    A list of selected instructions.

    | Improve this Doc View Source

    CreateStoreRegister(ValueTag, IType)

    Creates instructions that stores a value into its virtual register.

    Declaration
    IReadOnlyList<TInstruction> CreateStoreRegister(ValueTag value, IType type)
    Parameters
    Type Name Description
    ValueTag value

    The value to store.

    IType type

    The type of value.

    Returns
    Type Description
    System.Collections.Generic.IReadOnlyList<TInstruction>

    A list of selected instructions.

    | Improve this Doc View Source

    Pushes(InstructionPrototype)

    Tells if instances of a particular instruction prototype actually push a value onto the stack. Instructions that do not push values must either ensure that their result is never used or spill their result into the appropriate virtual register on their own.

    Declaration
    bool Pushes(InstructionPrototype prototype)
    Parameters
    Type Name Description
    InstructionPrototype prototype

    The instruction prototype to inspect.

    Returns
    Type Description
    System.Boolean

    true if instances of prototype push a value onto the stack; otherwise false.

    | Improve this Doc View Source

    TryCreateDup(IType, out IReadOnlyList<TInstruction>)

    Tries to create instructions that duplicate the top-of-stack value.

    Declaration
    bool TryCreateDup(IType type, out IReadOnlyList<TInstruction> dup)
    Parameters
    Type Name Description
    IType type

    The type of value to duplicate.

    System.Collections.Generic.IReadOnlyList<TInstruction> dup

    A sequence of instructions that duplicate the top-of-stack value, if they can be created.

    Returns
    Type Description
    System.Boolean

    true if a sequence of instructions exists that can efficiently duplicate the top-of-stack value; otherwise, false.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX