org.jikesrvm.adaptive.util
Class UnResolvedWeightedCallTargets.UnResolvedSingleTarget

java.lang.Object
  extended by org.jikesrvm.adaptive.util.UnResolvedWeightedCallTargets
      extended by org.jikesrvm.adaptive.util.UnResolvedWeightedCallTargets.UnResolvedSingleTarget
Enclosing class:
UnResolvedWeightedCallTargets

private static final class UnResolvedWeightedCallTargets.UnResolvedSingleTarget
extends UnResolvedWeightedCallTargets

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.util.UnResolvedWeightedCallTargets
UnResolvedWeightedCallTargets.Visitor
 
Field Summary
private  MethodReference target
           
private  float weight
           
 
Constructor Summary
UnResolvedWeightedCallTargets.UnResolvedSingleTarget(MethodReference t, double w)
           
 
Method Summary
 UnResolvedWeightedCallTargets augmentCount(MethodReference 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
 UnResolvedWeightedCallTargets filter(MethodReference goal)
           
 double totalWeight()
          totalWeight of all call targets
 void visitTargets(UnResolvedWeightedCallTargets.Visitor func)
          Iterate over all of the targets, evaluating the argument function on each edge.
 
Methods inherited from class org.jikesrvm.adaptive.util.UnResolvedWeightedCallTargets
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 MethodReference target

weight

private float weight
Constructor Detail

UnResolvedWeightedCallTargets.UnResolvedSingleTarget

UnResolvedWeightedCallTargets.UnResolvedSingleTarget(MethodReference t,
                                                     double w)
Method Detail

visitTargets

public void visitTargets(UnResolvedWeightedCallTargets.Visitor func)
Description copied from class: UnResolvedWeightedCallTargets
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 UnResolvedWeightedCallTargets
Parameters:
func - the function to evaluate on each target

augmentCount

public UnResolvedWeightedCallTargets augmentCount(MethodReference t,
                                                  double v)
Description copied from class: UnResolvedWeightedCallTargets
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 UnResolvedWeightedCallTargets accordingly to avoid losing the update.

Specified by:
augmentCount in class UnResolvedWeightedCallTargets

decay

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

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

totalWeight

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

Specified by:
totalWeight in class UnResolvedWeightedCallTargets

filter

public UnResolvedWeightedCallTargets filter(MethodReference goal)
Specified by:
filter in class UnResolvedWeightedCallTargets
Parameters:
goal - MethodReference that is the only statically possible target
Returns:
the filtered call targets or null if no such target exists