org.jikesrvm.compilers.opt.bc2ir
Class BasicBlockLE

java.lang.Object
  extended by org.jikesrvm.compilers.opt.bc2ir.BasicBlockLE
Direct Known Subclasses:
HandlerBlockLE, InliningBlockLE

 class BasicBlockLE
extends Object

This class is used as a 'wrapper' to a basic block to hold information that is necessary only for IR generation.


Field Summary
(package private)  BasicBlock block
          Basic block that this BBLE refers to.
private static byte COLOR
           
(package private)  BasicBlockLE fallThrough
          The desired fallthrough (next in code order) BBLE (may be null).
private  byte flags
          Encoding of random boolean state
private static byte GENERATED
           
(package private)  HandlerBlockLE[] handlers
          The exception handler BBLE's for this block (null if none)
(package private)  int high
          Current end bytecode of this BBLE
private static byte IN_CODE_ORDER
           
(package private)  BasicBlockLE left
           
private static byte LOCAL_KNOWN
           
(package private)  Operand[] localState
          State of the local variables at the start of this basic block.
(package private)  int low
          Start bytecode of this BBLE
(package private)  int max
          Maximum possible bytecode of this BBLE (wrt exception ranges)
(package private)  BasicBlockLE parent
           
(package private)  BasicBlockLE right
           
private static byte SELF_REGEN
           
private static byte STACK_KNOWN
           
(package private)  OperandStack stackState
          State of the stack at the start of this basic block.
 
Constructor Summary
protected BasicBlockLE(int loc)
           
(package private) BasicBlockLE(int loc, InlineSequence position, ControlFlowGraph cfg)
          Create a new BBLE (and basic block) for the specified bytecode index.
 
Method Summary
(package private)  void addHandler(HandlerBlockLE handler)
          Add an exception handler BBLE to the handlers array.
(package private)  void clearGenerated()
           
(package private)  void clearInCodeOrder()
           
(package private)  void clearLocalKnown()
           
(package private)  void clearSelfRegen()
           
(package private)  void clearStackKnown()
           
(package private)  void copyIntoLocalState(Operand[] _localState)
          Save a shallow copy of the given local variable state into this.
(package private)  Operand[] copyLocalState()
          Return a shallow copy of my local state.
 String genState()
          Returns a string representation of state that determines if the BBLE is ready to be generated
(package private)  boolean isBlack()
           
(package private)  boolean isGenerated()
           
(package private)  boolean isInCodeOrder()
           
(package private)  boolean isLocalKnown()
           
(package private)  boolean isReadyToGenerate()
          Is the BBLE ready to generate?
(package private)  boolean isRed()
           
(package private)  boolean isSelfRegen()
           
(package private)  boolean isStackKnown()
           
(package private)  void setBlack()
           
(package private)  void setGenerated()
           
(package private)  void setInCodeOrder()
           
(package private)  void setLocalKnown()
           
(package private)  void setRed()
           
(package private)  void setSelfRegen()
           
(package private)  void setStackKnown()
           
 String toString()
          Returns a string representation of this BBLE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

BasicBlockLE parent

left

BasicBlockLE left

right

BasicBlockLE right

low

final int low
Start bytecode of this BBLE


high

int high
Current end bytecode of this BBLE


max

int max
Maximum possible bytecode of this BBLE (wrt exception ranges)


block

BasicBlock block
Basic block that this BBLE refers to.


stackState

OperandStack stackState
State of the stack at the start of this basic block.


localState

Operand[] localState
State of the local variables at the start of this basic block.


fallThrough

BasicBlockLE fallThrough
The desired fallthrough (next in code order) BBLE (may be null). NOTE: we may not always end up actually falling through (see BBSet.finalPass).


handlers

HandlerBlockLE[] handlers
The exception handler BBLE's for this block (null if none)


flags

private byte flags
Encoding of random boolean state


STACK_KNOWN

private static final byte STACK_KNOWN
See Also:
Constant Field Values

LOCAL_KNOWN

private static final byte LOCAL_KNOWN
See Also:
Constant Field Values

SELF_REGEN

private static final byte SELF_REGEN
See Also:
Constant Field Values

GENERATED

private static final byte GENERATED
See Also:
Constant Field Values

COLOR

private static final byte COLOR
See Also:
Constant Field Values

IN_CODE_ORDER

private static final byte IN_CODE_ORDER
See Also:
Constant Field Values
Constructor Detail

BasicBlockLE

BasicBlockLE(int loc,
             InlineSequence position,
             ControlFlowGraph cfg)
Create a new BBLE (and basic block) for the specified bytecode index.

Parameters:
loc - bytecode index
position - the inline sequence
cfg - ControlFlowGraph into which the block will eventually be inserted

BasicBlockLE

protected BasicBlockLE(int loc)
Method Detail

setStackKnown

final void setStackKnown()

clearStackKnown

final void clearStackKnown()

isStackKnown

final boolean isStackKnown()

setLocalKnown

final void setLocalKnown()

clearLocalKnown

final void clearLocalKnown()

isLocalKnown

final boolean isLocalKnown()

setSelfRegen

final void setSelfRegen()

clearSelfRegen

final void clearSelfRegen()

isSelfRegen

final boolean isSelfRegen()

setGenerated

final void setGenerated()

clearGenerated

final void clearGenerated()

isGenerated

final boolean isGenerated()

setBlack

final void setBlack()

isBlack

final boolean isBlack()

setRed

final void setRed()

isRed

final boolean isRed()

setInCodeOrder

final void setInCodeOrder()

clearInCodeOrder

final void clearInCodeOrder()

isInCodeOrder

final boolean isInCodeOrder()

isReadyToGenerate

final boolean isReadyToGenerate()
Is the BBLE ready to generate?


copyIntoLocalState

final void copyIntoLocalState(Operand[] _localState)
Save a shallow copy of the given local variable state into this.

Parameters:
_localState - local variable state to save

copyLocalState

final Operand[] copyLocalState()
Return a shallow copy of my local state.


addHandler

final void addHandler(HandlerBlockLE handler)
Add an exception handler BBLE to the handlers array. NOTE: this isn't incredibly efficient, but empirically the expected number of handlers per basic block is 0, with an observed maximum across 10,000+ methods of 3. Until this changes, we just don't care.


toString

public String toString()
Returns a string representation of this BBLE.

Overrides:
toString in class Object

genState

public String genState()
Returns a string representation of state that determines if the BBLE is ready to be generated