org.jikesrvm.adaptive.database.callgraph
Class WeightedCallTargets.SingleTarget

java.lang.Object
  extended by org.jikesrvm.adaptive.database.callgraph.WeightedCallTargets
      extended by org.jikesrvm.adaptive.database.callgraph.WeightedCallTargets.SingleTarget
Enclosing class:
WeightedCallTargets

private static final class WeightedCallTargets.SingleTarget
extends WeightedCallTargets

An implementation for storing a call site distribution that has a single target.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jikesrvm.adaptive.database.callgraph.WeightedCallTargets
WeightedCallTargets.Visitor
 
Field Summary
private  RVMMethod target
           
private  float weight
           
 
Constructor Summary
WeightedCallTargets.SingleTarget(RVMMethod t, double w)
           
 
Method Summary
 WeightedCallTargets augmentCount(RVMMethod t, double v)
          Augment the weight associated with the argument method by the argument amount.
 void decay(double rate)
          Decay the weights of all call targets by the specified amount
 WeightedCallTargets filter(RVMMethod goal, boolean isPrecise)
           
 double totalWeight()
          totalWeight of all call targets
 void visitTargets(WeightedCallTargets.Visitor func)
          Iterate over all of the targets, evaluating the argument function on each edge.
 
Methods inherited from class org.jikesrvm.adaptive.database.callgraph.WeightedCallTargets
create, incrementCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

private final RVMMethod target

weight

private float weight
Constructor Detail

WeightedCallTargets.SingleTarget

WeightedCallTargets.SingleTarget(RVMMethod t,
                                 double w)
Method Detail

visitTargets

public void visitTargets(WeightedCallTargets.Visitor func)
Description copied from class: WeightedCallTargets
Iterate over all of the targets, evaluating the argument function on each edge.

NOTE: We guarantee that the targets will be iterated in monotonically decreasing edge weight. This simplifies the coding of the inlining clients that consume this information.

Specified by:
visitTargets in class WeightedCallTargets
Parameters:
func - the function to evaluate on each target

augmentCount

public WeightedCallTargets augmentCount(RVMMethod t,
                                        double v)
Description copied from class: WeightedCallTargets
Augment the weight associated with the argument method by the argument amount. NOTE: This method may change the representation of the target method. The caller must be sure to update their backing store of WeightedCallTargets accordingly to avoid losing the update.

Specified by:
augmentCount in class WeightedCallTargets

decay

public void decay(double rate)
Description copied from class: WeightedCallTargets
Decay the weights of all call targets by the specified amount

Specified by:
decay in class WeightedCallTargets
Parameters:
rate - the value to decay by

totalWeight

public double totalWeight()
Description copied from class: WeightedCallTargets
totalWeight of all call targets

Specified by:
totalWeight in class WeightedCallTargets

filter

public WeightedCallTargets filter(RVMMethod goal,
                                  boolean isPrecise)
Specified by:
filter in class WeightedCallTargets
Parameters:
goal - RVMMethod that is the statically possible target
isPrecise - whether or not goal is a precise target, or should be interpreted as being the root of a virtual method family, any of which are statically possible.
Returns:
the filtered call targets or null if no such target exists