Search Results for

    Show / Hide Table of Contents

    Class StackInstructionStreamBuilder<TInstruction>

    An instruction stream builder that manages data transfer using a combination of stack slots and explicit register loads/stores, as commonly offered by stack machines.

    Inheritance
    object
    InstructionStreamBuilder<TInstruction>
    StackInstructionStreamBuilder<TInstruction>
    Inherited Members
    InstructionStreamBuilder<TInstruction>.InstructionSelector
    InstructionStreamBuilder<TInstruction>.ToInstructionStream(FlowGraph)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Flame.Compiler.Target
    Assembly: Flame.Compiler.dll
    Syntax
    public class StackInstructionStreamBuilder<TInstruction> : InstructionStreamBuilder<TInstruction>
    Type Parameters
    Name Description
    TInstruction

    The type of instruction to generate.

    Constructors

    | Edit this page View Source

    StackInstructionStreamBuilder(ILinearInstructionSelector<TInstruction>)

    Creates a stack machine instruction stream builder.

    Declaration
    protected StackInstructionStreamBuilder(ILinearInstructionSelector<TInstruction> instructionSelector)
    Parameters
    Type Name Description
    ILinearInstructionSelector<TInstruction> instructionSelector

    The instruction selector to use. This instruction selector must also be a stack instruction selector.

    Methods

    | Edit this page View Source

    Create<TSelector>(TSelector)

    Creates a linear instruction stream builder.

    Declaration
    public static StackInstructionStreamBuilder<TInstruction> Create<TSelector>(TSelector instructionSelector) where TSelector : ILinearInstructionSelector<TInstruction>, IStackInstructionSelector<TInstruction>
    Parameters
    Type Name Description
    TSelector instructionSelector

    The instruction selector to use.

    Returns
    Type Description
    StackInstructionStreamBuilder<TInstruction>
    Type Parameters
    Name Description
    TSelector
    | Edit this page View Source

    GetStackContentsOnEntry(BasicBlock)

    Gets the contents of the evaluation stack just before a basic block's first instruction is executed.

    Declaration
    protected virtual IEnumerable<ValueTag> GetStackContentsOnEntry(BasicBlock block)
    Parameters
    Type Name Description
    BasicBlock block

    The basic block to inspect.

    Returns
    Type Description
    IEnumerable<ValueTag>

    A sequence of values that represent the contents of the stack.

    | Edit this page View Source

    ShouldMaterializeOnUse(NamedInstruction)

    Tells if an instruction should always be materialized when it is used rather than when it is defined.

    Declaration
    protected virtual bool ShouldMaterializeOnUse(NamedInstruction instruction)
    Parameters
    Type Name Description
    NamedInstruction instruction

    An instruction to inspect.

    Returns
    Type Description
    bool

    true if instruction should be materialized when it is used instead of when it is defined; otherwise, false.

    | Edit this page View Source

    ToInstructionStream(BasicBlock, IReadOnlyDictionary<ValueTag, SelectedInstructions<TInstruction>>, SelectedFlowInstructions<TInstruction>)

    Creates a linear sequence of instructions for a basic block based on selected instructions for named instructions and block flow.

    Declaration
    protected override IReadOnlyList<TInstruction> ToInstructionStream(BasicBlock block, IReadOnlyDictionary<ValueTag, SelectedInstructions<TInstruction>> instructions, SelectedFlowInstructions<TInstruction> flow)
    Parameters
    Type Name Description
    BasicBlock block

    The basic blocks to place.

    IReadOnlyDictionary<ValueTag, SelectedInstructions<TInstruction>> instructions

    A mapping of named instructions to their selected instructions. Named instructions that do not appear in this mapping should not be selected.

    SelectedFlowInstructions<TInstruction> flow

    Selected instructions for block's control flow.

    Returns
    Type Description
    IReadOnlyList<TInstruction>

    A linear sequence of instructions.

    Overrides
    InstructionStreamBuilder<TInstruction>.ToInstructionStream(BasicBlock, IReadOnlyDictionary<ValueTag, SelectedInstructions<TInstruction>>, SelectedFlowInstructions<TInstruction>)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX