use of org.jikesrvm.compilers.opt.regalloc.LiveIntervalElement in project JikesRVM by JikesRVM.
the class LiveAnalysis method getLiveRegistersOnEntry.
/**
* @param bb the basic block we're interested in
* @return the set of registers that are live across a basic block, and who
* are live before the basic block entry.
*/
HashSet<Register> getLiveRegistersOnEntry(BasicBlock bb) {
HashSet<Register> result = new HashSet<Register>(10);
for (Enumeration<LiveIntervalElement> e = liveIntervals.enumerateLiveIntervals(bb); e.hasMoreElements(); ) {
LiveIntervalElement lie = e.nextElement();
Instruction begin = lie.getBegin();
if (begin == null)
result.add(lie.getRegister());
}
return result;
}
use of org.jikesrvm.compilers.opt.regalloc.LiveIntervalElement in project JikesRVM by JikesRVM.
the class LiveAnalysis method getLiveRegistersOnExit.
/**
* @param bb the basic block we're interested in
* @return the set of registers that are live across a basic block, and who
* are live after the basic block exit.
*/
HashSet<Register> getLiveRegistersOnExit(BasicBlock bb) {
HashSet<Register> result = new HashSet<Register>(10);
for (Enumeration<LiveIntervalElement> e = liveIntervals.enumerateLiveIntervals(bb); e.hasMoreElements(); ) {
LiveIntervalElement lie = e.nextElement();
Instruction end = lie.getEnd();
if (end == null)
result.add(lie.getRegister());
}
return result;
}
use of org.jikesrvm.compilers.opt.regalloc.LiveIntervalElement in project JikesRVM by JikesRVM.
the class LiveAnalysis method merge.
/**
* Update the data structures to reflect that all live intervals for r2
* are now intervals for r1.
*
* @param r1 old register
* @param r2 new register
*/
public void merge(Register r1, Register r2) {
Iterator<LiveIntervalElement> i = iterateLiveIntervals(r2);
while (i.hasNext()) {
LiveIntervalElement interval = i.next();
interval.setRegister(r1);
addToRegisterMap(r1, interval);
i.remove();
}
}
use of org.jikesrvm.compilers.opt.regalloc.LiveIntervalElement in project JikesRVM by JikesRVM.
the class LiveInterval method containsUnresolvedElement.
/**
* Check to see if an unresolved LiveIntervalElement node for the register
* passed exists for the basic block passed.
*
* @param block the block
* @param reg the register of interest
* @return <code>true</code> if it does or <code>false</code>
* if it does not
*/
private boolean containsUnresolvedElement(BasicBlock block, Register reg) {
if (DEBUG) {
System.out.println("containsUnresolvedElement called, block: " + block + " register: " + reg);
printLiveIntervalList(block);
}
for (LiveIntervalElement elem = getFirstLiveIntervalElement(block); elem != null; elem = elem.getNext()) {
// if we got an element, down case it to LiveIntervalElement
if (elem.getRegister() == reg && elem.getBegin() == null) {
return true;
}
}
return false;
}
use of org.jikesrvm.compilers.opt.regalloc.LiveIntervalElement in project JikesRVM by JikesRVM.
the class LiveInterval method moveUpwardExposedRegsToFront.
/**
* 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.
*
* @param block the basic block of interest
*/
public void moveUpwardExposedRegsToFront(BasicBlock block) {
LiveIntervalElement prev = getFirstLiveIntervalElement(block);
if (prev == null) {
return;
}
// The first element is already at the front, so move on to the next one
LiveIntervalElement elem = prev.getNext();
while (elem != null) {
if (elem.getBegin() == null) {
// remove elem from current position
prev.setNext(elem.getNext());
// add it to the begining, se
prependLiveIntervalElement(block, elem);
// the next victum is the *new* one after prev
elem = prev.getNext();
} else {
prev = elem;
elem = elem.getNext();
}
}
}
Aggregations