scala.tools.nsc.backend.icode.BasicBlocks

BasicBlock

class BasicBlock extends ProgramPoint[BasicBlock]

This class represents a basic block. Each basic block contains a list of instructions that are either executed all, or none. No jumps to/from the "middle" of the basic block are allowed (modulo exceptions).

Self Type
BasicBlock
Source
BasicBlocks.scala
Linear Supertypes
ProgramPoint[BasicBlock], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. BasicBlock
  2. ProgramPoint
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BasicBlock(label: Int, method: IMethod)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def apply(n: Int): Instruction

    Return the n-th instruction.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def blockContents: String

  9. def clear(): Unit

  10. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def close(): Unit

    Close the block

  12. def closeWith(instr: Instruction, pos: Position): Unit

  13. def closeWith(instr: Instruction): Unit

    do nothing if block is already closed

  14. def closed: Boolean

    Is this block closed?

  15. def closed_=(b: Boolean): Unit

  16. def code: Code

  17. def directSuccessors: List[BasicBlock]

  18. def emit(is: Seq[Instruction]): Unit

  19. def emit(instr: Instruction, pos: Position): Unit

    Emitting does not set touched to true.

    Emitting does not set touched to true. During code generation this is a hotspot and setting the flag for each emit is a waste. Caching should happen only after a block is closed, which sets the DIRTYSUCCS flag.

  20. def emit(instr: Instruction): Unit

    Add a new instruction at the end of the block, using the same source position as the last emitted instruction

  21. def emitOnly(is: Instruction*): Unit

    The semantics of this are a little odd but it's designed to work seamlessly with the existing code.

    The semantics of this are a little odd but it's designed to work seamlessly with the existing code. It emits each supplied instruction, then closes the block. The odd part is that if the instruction has pos == NoPosition, it calls the 1-arg emit, but otherwise it calls the 2-arg emit. This way I could retain existing behavior exactly by calling setPos on any instruction using the two arg version which I wanted to include in a call to emitOnly.

  22. def enterIgnoreMode(): Unit

    Enter ignore mode: new 'emit'ted instructions will not be added to this basic block.

    Enter ignore mode: new 'emit'ted instructions will not be added to this basic block. It makes the generation of THROW and RETURNs easier.

  23. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def equals(other: Any): Boolean

    Definition Classes
    BasicBlock → AnyRef → Any
  25. def exceptionHandlerStart: Boolean

    Is this block the start block of an exception handler?

    Is this block the start block of an exception handler?

    Definition Classes
    BasicBlockProgramPoint
  26. def exceptionHandlerStart_=(b: Boolean): Unit

  27. def exceptionSuccessors: List[BasicBlock]

  28. def exceptionSuccessorsForBlock(block: BasicBlock): List[BasicBlock]

  29. def exitIgnoreMode(): Unit

  30. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. def firstInstruction: Instruction

  32. def flagsString: String

  33. final def foreach[U](f: (Instruction) ⇒ U): Unit

    Apply a function to all the instructions of the block.

  34. def fromList(is: List[Instruction]): Unit

  35. def fullString: String

  36. def getArray: Array[Instruction]

    return the underlying array of instructions

  37. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  38. def hasFlag(flag: Int): Boolean

    Does this block have the given flag?

  39. def hashCode(): Int

    Definition Classes
    BasicBlock → AnyRef → Any
  40. def ignore: Boolean

    When set, the emit methods will be ignored.

  41. def ignore_=(b: Boolean): Unit

  42. def indexOf(inst: Instruction): Int

    Return the index of inst.

    Return the index of inst. Uses reference equality. Returns -1 if not found.

  43. def insertAfter(idx: Int, is: List[Instruction]): Unit

    Insert instructions in 'is' immediately after index 'idx'.

  44. final def isEmpty: Boolean

  45. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  46. def iterator: Iterator[Instruction]

    Return an iterator over the instructions in this basic block.

  47. val label: Int

  48. def lastInstruction: Instruction

    Return the last instruction of this basic block.

  49. def length: Int

    The number of instructions in this basic block so far.

  50. def loopHeader: Boolean

    Is this block the head of a while?

  51. def loopHeader_=(b: Boolean): Unit

  52. val method: IMethod

  53. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  54. final def nonEmpty: Boolean

  55. final def notify(): Unit

    Definition Classes
    AnyRef
  56. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  57. def open(): Unit

  58. def predContents: String

  59. def predecessors: List[BasicBlock]

    Returns the predecessors of this block.

    Returns the predecessors of this block.

    Definition Classes
    BasicBlockProgramPoint
  60. var preds: List[BasicBlock]

    Cached predecessors.

  61. def print(out: PrintStream): Unit

  62. def print(): Unit

  63. def removeInstructionsAt(positions: Int*): Unit

    Removes instructions found at the given positions.

    Removes instructions found at the given positions.

    positions

    ...

  64. def removeLastInstruction(): Unit

    Remove the last instruction of this basic block.

    Remove the last instruction of this basic block. It is fast for an open block, but slower when the block is closed.

  65. def replaceInstruction(oldInstr: Instruction, is: List[Instruction]): Boolean

    Replaces oldInstr with is.

    Replaces oldInstr with is. It does not update the position field in the newly inserted instructions, so it behaves differently than the one-instruction versions of this function.

    is

    ..

    returns

    ..

  66. def replaceInstruction(oldInstr: Instruction, newInstr: Instruction): Boolean

    Replace the given instruction with the new one.

    Replace the given instruction with the new one. Returns true if it actually changed something. It retains the position of the previous instruction.

  67. def replaceInstruction(pos: Int, instr: Instruction): Boolean

    Replace the instruction at the given position.

    Replace the instruction at the given position. Used by labels when they are anchored. It retains the position of the previous instruction.

  68. def size: Int

  69. def subst(map: Map[Instruction, Instruction]): Unit

    Replaces all instructions found in the map.

    Replaces all instructions found in the map.

    map

    ...

  70. def succContents: String

  71. def successors: List[BasicBlock]

    Definition Classes
    BasicBlockProgramPoint
  72. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  73. def take(n: Int): Seq[Instruction]

  74. def toList: List[Instruction]

  75. def toString(): String

    Definition Classes
    BasicBlock → AnyRef → Any
  76. def touched: Boolean

    Has this basic block been modified since the last call to 'successors'?

  77. def touched_=(b: Boolean): Unit

  78. val varsInScope: Set[Local]

    Local variables that are in scope at entry of this basic block.

    Local variables that are in scope at entry of this basic block. Used for debugging information.

  79. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  80. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  81. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from ProgramPoint[BasicBlock]

Inherited from AnyRef

Inherited from Any