org.jikesrvm.adaptive.util
Class UnResolvedWeightedCallTargets.UnResolvedMultiTarget

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

private static final class UnResolvedWeightedCallTargets.UnResolvedMultiTarget
extends UnResolvedWeightedCallTargets

An implementation for storing a call site distribution that has multiple targets.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jikesrvm.adaptive.util.UnResolvedWeightedCallTargets
UnResolvedWeightedCallTargets.Visitor
 
Field Summary
(package private)  MethodReference[] methods
           
(package private)  float[] weights
           
 
Constructor Summary
private UnResolvedWeightedCallTargets.UnResolvedMultiTarget()
           
 
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

methods

MethodReference[] methods

weights

float[] weights
Constructor Detail

UnResolvedWeightedCallTargets.UnResolvedMultiTarget

private UnResolvedWeightedCallTargets.UnResolvedMultiTarget()
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