org.jikesrvm.compilers.opt.regalloc
Class SpillCostEstimator

java.lang.Object
  extended by org.jikesrvm.compilers.opt.regalloc.SpillCostEstimator
Direct Known Subclasses:
BlockCountSpillCost, BrainDeadSpillCost, SimpleSpillCost

abstract class SpillCostEstimator
extends Object

An object that returns an estimate of the relative cost of spilling a symbolic register.


Field Summary
private  HashMap<Register,Double> map
           
 
Constructor Summary
SpillCostEstimator()
           
 
Method Summary
(package private) abstract  void calculate(IR ir)
          Calculate the estimated cost for each register.
(package private)  double getCost(Register r)
          Return a number that represents an estimate of the relative cost of spilling register r.
protected  void update(Register r, double delta)
          Update the cost for a particular register.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private final HashMap<Register,Double> map
Constructor Detail

SpillCostEstimator

SpillCostEstimator()
Method Detail

getCost

double getCost(Register r)
Return a number that represents an estimate of the relative cost of spilling register r.


calculate

abstract void calculate(IR ir)
Calculate the estimated cost for each register.


update

protected void update(Register r,
                      double delta)
Update the cost for a particular register.