Class LinearScanner

  • All Implemented Interfaces:
    Iterable<FlowNode>, Iterator<FlowNode>, Filterator<FlowNode>
    Direct Known Subclasses:
    LinearBlockHoppingScanner

    @NotThreadSafe
    public class LinearScanner
    extends AbstractFlowScanner
    Scans through the flow graph in strictly linear fashion, visiting only the first branch in parallel blocks.

    Iteration order: depth-ONLY, meaning we walk through parents and only follow the first parent of each FlowNode This means that where are parallel branches, we will only visit a partial set of FlowNodes in the directed acyclic graph.

    Use case: we don't care about parallel branches or know they don't exist, we just want to walk through the top-level blocks.

    This is the fastest and simplest way to walk a flow, because you only care about a single node at a time. Nuance: where there are multiple parent nodes (in a parallel block), and one is denylisted, we'll find the first non-denylisted one.

    Author:
    Sam Van Oort