Search in sources :

Example 1 with ASTORE

use of org.apache.bcel.generic.ASTORE 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;
}
Also used : RETURN(org.apache.bcel.generic.RETURN) GOTO(org.apache.bcel.generic.GOTO) ExecutionContext(com.jopdesign.common.code.ExecutionContext) ASTORE(org.apache.bcel.generic.ASTORE) WCETProcessorModel(com.jopdesign.wcet.WCETProcessorModel) InstructionList(org.apache.bcel.generic.InstructionList) ATHROW(org.apache.bcel.generic.ATHROW) IFNONNULL(org.apache.bcel.generic.IFNONNULL) DUP(org.apache.bcel.generic.DUP)

Aggregations

ExecutionContext (com.jopdesign.common.code.ExecutionContext)1 WCETProcessorModel (com.jopdesign.wcet.WCETProcessorModel)1 ASTORE (org.apache.bcel.generic.ASTORE)1 ATHROW (org.apache.bcel.generic.ATHROW)1 DUP (org.apache.bcel.generic.DUP)1 GOTO (org.apache.bcel.generic.GOTO)1 IFNONNULL (org.apache.bcel.generic.IFNONNULL)1 InstructionList (org.apache.bcel.generic.InstructionList)1 RETURN (org.apache.bcel.generic.RETURN)1