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
    System.Object
    InstructionStreamBuilder<TInstruction>
    StackInstructionStreamBuilder<TInstruction>
    Inherited Members
    InstructionStreamBuilder<TInstruction>.InstructionSelector
    InstructionStreamBuilder<TInstruction>.ToInstructionStream(FlowGraph)
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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

    | Improve this Doc 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

    | Improve this Doc 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
    | Improve this Doc 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
    System.Collections.Generic.IEnumerable<ValueTag>

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

    | Improve this Doc 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
    System.Boolean

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

    | Improve this Doc View Source

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

    Declaration
    protected override IReadOnlyList<TInstruction> ToInstructionStream(BasicBlock block, IReadOnlyDictionary<ValueTag, SelectedInstructions<TInstruction>> instructions, SelectedFlowInstructions<TInstruction> flow)
    Parameters
    Type Name Description
    BasicBlock block
    System.Collections.Generic.IReadOnlyDictionary<ValueTag, SelectedInstructions<TInstruction>> instructions
    SelectedFlowInstructions<TInstruction> flow
    Returns
    Type Description
    System.Collections.Generic.IReadOnlyList<TInstruction>
    Overrides
    Flame.Compiler.Target.InstructionStreamBuilder<TInstruction>.ToInstructionStream(Flame.Compiler.BasicBlock, System.Collections.Generic.IReadOnlyDictionary<Flame.Compiler.ValueTag, Flame.Compiler.Target.SelectedInstructions<TInstruction>>, Flame.Compiler.Target.SelectedFlowInstructions<TInstruction>)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX