use of com.jopdesign.jcopter.analysis.WCAInvoker in project jop by jop-devel.
the class WCEPRebateSelector method selectNextCandidates.
@Override
public Collection<Candidate> selectNextCandidates(ExecFrequencyProvider ecp) {
WCAInvoker wcaInvoker = analyses.getWCAInvoker();
Set<MethodInfo> visited = new LinkedHashSet<MethodInfo>();
LinkedList<MethodInfo> queue = new LinkedList<MethodInfo>();
// go down all methods in the callgraph which are on the WCET path, find best candidate
RebateRatio next = null;
queue.addAll(wcaInvoker.getWcaTargets());
visited.addAll(queue);
while (!queue.isEmpty()) {
MethodInfo method = queue.removeFirst();
MethodData data = methodData.get(method);
if (data == null)
continue;
// skip methods not on the WCET path
if (!wcaInvoker.isOnWCETPath(method)) {
continue;
}
// select best candidate from method or use previous method
next = selectCandidate(ecp, data, next);
// add childs to queue if not already visited
for (MethodInfo child : analyses.getTargetCallGraph().getInvokedMethods(method)) {
if (visited.add(child)) {
queue.add(child);
}
}
}
logSelection(ecp, next);
return next != null ? next.getCandidates() : null;
}
Aggregations