use of org.apache.bcel.generic.IFNONNULL in project jop by jop-devel.
the class InlineOptimizer method initialize.
@Override
public void initialize(AnalysisManager analyses, Collection<MethodInfo> roots) {
if (!preciseCycleEstimate) {
ExecutionContext dummy = new ExecutionContext(roots.iterator().next());
WCETProcessorModel pm = analyses.getJCopter().getWCETProcessorModel();
InstructionList il = new InstructionList();
// TODO very messy approximation of exec time
storeCycles = (int) pm.getExecutionTime(dummy, il.append(new ASTORE(10)));
checkNPCycles = 0;
checkNPCycles += (int) pm.getExecutionTime(dummy, il.append(new DUP()));
checkNPCycles += (int) pm.getExecutionTime(dummy, il.append(new IFNONNULL(il.append(new ATHROW()))));
deltaReturnCycles = (int) pm.getExecutionTime(dummy, il.append(new RETURN()));
deltaReturnCycles -= (int) pm.getExecutionTime(dummy, il.append(new GOTO(il.getEnd())));
}
countInvokeSites = 0;
countDevirtualized = 0;
}
Aggregations