Package iota

Class NBasicBlock

java.lang.Object
iota.NBasicBlock

class NBasicBlock extends Object
Representation of a basic block within a control-flow graph (cfg).
  • Field Details

    • id

      public int id
      Unique identifier of this block.
    • cfg

      public NControlFlowGraph cfg
      The cfg that this block belongs to.
    • tuples

      public ArrayList<NTuple> tuples
      List of tuples in this block.
    • isVisited

      public boolean isVisited
      Has this block been visited?
    • isActive

      public boolean isActive
      Is this block active?
    • predecessors

      public ArrayList<NBasicBlock> predecessors
      List of predecessors of this block.
    • successors

      public ArrayList<NBasicBlock> successors
      List of successors of this block.
    • isLoopHead

      public boolean isLoopHead
      Is this block a loop head?
    • isLoopTail

      public boolean isLoopTail
      Is this block a loop tail?
    • locals

      public NHirInstruction[] locals
      State vector of this block.
    • hir

      List of high-level (HIR) instructions in this block.
    • lir

      List of low-level (LIR) instructions in this block.
    • marvin

      public ArrayList<NMarvinInstruction> marvin
      List of Marvin (ie, target machine) instructions in this block.
    • liveUse

      public BitSet liveUse
      The local liveUse set (registers that are used before they are defined in this block).
    • liveDef

      public BitSet liveDef
      The local liveDef set (registers that are written to in this block).
    • liveIn

      public BitSet liveIn
      The global liveIn set (this.liveOut - this.liveDef + this.liveUse).
    • liveOut

      public BitSet liveOut
      The global liveOut set (union of s.liveIn for each successor s of this block).
  • Constructor Details

    • NBasicBlock

      public NBasicBlock(NControlFlowGraph cfg, int id)
      Constructs an NBasicBlock object.
      Parameters:
      cfg - the cfg containing the block.
      id - id of the block.
  • Method Details

    • id

      public String id()
      Returns the id of this block as a string.
      Returns:
      the id of this block as a string.
    • equals

      public boolean equals(NBasicBlock other)
      Returns true if this block and other have the same id, and false otherwise.
      Parameters:
      other - the other block.
      Returns:
      true if this block and other have the same id, and false otherwise.
    • toString

      public String toString()
      Returns a string representation of this block.
      Overrides:
      toString in class Object
      Returns:
      string representation of this block.
    • writeTuplesToStdOut

      public void writeTuplesToStdOut(PrettyPrinter p)
      Writes the tuples in this block to standard output.
      Parameters:
      p - for pretty printing with indentation.
    • writeHirToStdOut

      public void writeHirToStdOut(PrettyPrinter p)
      Writes the HIR instructions in this block to standard output.
      Parameters:
      p - for pretty printing with indentation.
    • writeLirToStdOut

      public void writeLirToStdOut(PrettyPrinter p)
      Writes the LIR instructions in this block to standard output.
      Parameters:
      p - for pretty printing with indentation.
    • writeLivenessSetsToStdOut

      public void writeLivenessSetsToStdOut(PrettyPrinter p)
      Writes the liveness sets in this block to standard output.
      Parameters:
      p - for pretty printing with indentation.