private static final class WeightedCallTargets.SingleTarget extends WeightedCallTargets
WeightedCallTargets.Visitor
Modifier and Type | Field and Description |
---|---|
private RVMMethod |
target |
private float |
weight |
Constructor and Description |
---|
SingleTarget(RVMMethod t,
double w) |
Modifier and Type | Method and Description |
---|---|
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() |
void |
visitTargets(WeightedCallTargets.Visitor func)
Iterate over all of the targets, evaluating the argument function on each edge.
|
create, incrementCount
SingleTarget(RVMMethod t, double w)
public void visitTargets(WeightedCallTargets.Visitor func)
WeightedCallTargets
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.
visitTargets
in class WeightedCallTargets
func
- the function to evaluate on each targetpublic WeightedCallTargets augmentCount(RVMMethod t, double v)
WeightedCallTargets
augmentCount
in class WeightedCallTargets
t
- the method whose count is to be incrementedv
- amount to increment bypublic void decay(double rate)
WeightedCallTargets
decay
in class WeightedCallTargets
rate
- the value to decay bypublic double totalWeight()
totalWeight
in class WeightedCallTargets
public WeightedCallTargets filter(RVMMethod goal, boolean isPrecise)
filter
in class WeightedCallTargets
goal
- RVMMethod that is the statically possible targetisPrecise
- 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.null
if no such target exists