org.jikesrvm.compilers.opt.ir
Class WeightedBranchTargets
java.lang.Object
org.jikesrvm.compilers.opt.ir.WeightedBranchTargets
public final class WeightedBranchTargets
- extends Object
Used to iterate over the branch targets (including the fall through edge)
and associated probabilites of a basic block.
Takes into account the ordering of branch instructions when
computing the edge weights such that the total target weight will always
be equal to 1.0 (flow in == flow out).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
targets
private BasicBlock[] targets
weights
private float[] weights
cur
private int cur
max
private int max
WeightedBranchTargets
public WeightedBranchTargets(BasicBlock bb)
reset
public void reset()
hasMoreElements
public boolean hasMoreElements()
advance
public void advance()
curBlock
public BasicBlock curBlock()
curWeight
public float curWeight()
addEdge
private void addEdge(BasicBlock target,
float weight)
epsilon
private boolean epsilon(float a,
float b)