org.jikesrvm.compilers.opt.liveness
Class LiveInterval

java.lang.Object
  extended by org.jikesrvm.compilers.opt.liveness.LiveInterval

final class LiveInterval
extends Object

This class contains useful methods for managing liveIntervals.


Field Summary
private static boolean DEBUG
           
 
Constructor Summary
LiveInterval()
           
 
Method Summary
private static boolean containsUnresolvedElement(BasicBlock block, Register reg)
          Check to see if an unresolved LiveIntervalElement node for the register passed exists for the basic block passed.
static void createEndLiveRange(LiveSet set, BasicBlock block, Instruction inst)
          This method iterates over each element in the the passed live set.
static void createEndLiveRange(Register reg, BasicBlock block, Instruction inst)
          This method checks if an existing unresolved live interval node, i.e., one that has an end instruction, but no beginning instruction, is present for the register and basic block passed.
static void moveUpwardExposedRegsToFront(BasicBlock block)
          This method finds any LiveInterval node that does not have a start instruction (it is null) and moves this node to the front of the list.
static void printLiveIntervalList(BasicBlock block)
          Print the live intervals for a block.
static void setStartLiveRange(Register reg, Instruction inst, BasicBlock block)
          This method finds the LiveInterval node for the register and basic block passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

LiveInterval

LiveInterval()
Method Detail

createEndLiveRange

public static void createEndLiveRange(LiveSet set,
                                      BasicBlock block,
                                      Instruction inst)
This method iterates over each element in the the passed live set. For each element, it checks if an existing live interval node for the basic block passed exists. If one does not exist, it creates a node with the end instruction being "inst". If one already exists no action is taken.

Parameters:
set - the set of registers, encoded as a LiveSet object
block - the basic block
inst - the instruction where the register's live range ends, null represents the end of the basic block

createEndLiveRange

public static void createEndLiveRange(Register reg,
                                      BasicBlock block,
                                      Instruction inst)
This method checks if an existing unresolved live interval node, i.e., one that has an end instruction, but no beginning instruction, is present for the register and basic block passed. If one does not exist, it creates a node with the end instruction being inst. If one already exists no action is taken.

Parameters:
reg - The register
block - The basic block
inst - The end instruction to use, if we have to create a neode.

setStartLiveRange

public static void setStartLiveRange(Register reg,
                                     Instruction inst,
                                     BasicBlock block)
This method finds the LiveInterval node for the register and basic block passed. It then sets the begin instruction to the instruction passed and moves the node to the proper place on the list block list. (The block list is sorted by "begin" instruction.

Parameters:
reg - the register of interest
inst - the "begin" instruction
block - the basic block of interest

moveUpwardExposedRegsToFront

public static void moveUpwardExposedRegsToFront(BasicBlock block)
This method finds any LiveInterval node that does not have a start instruction (it is null) and moves this node to the front of the list.

Parameters:
block - the basic block of interest

containsUnresolvedElement

private static boolean containsUnresolvedElement(BasicBlock block,
                                                 Register reg)
Check to see if an unresolved LiveIntervalElement node for the register passed exists for the basic block passed.

Parameters:
block - the block
reg - the register of interest
Returns:
true if it does or false if it does not

printLiveIntervalList

public static void printLiveIntervalList(BasicBlock block)
Print the live intervals for a block.

Parameters:
block - the block