Search in sources :

Example 6 with BasicBlockNode

use of com.jopdesign.common.code.ControlFlowGraph.BasicBlockNode in project jop by jop-devel.

the class WCETTool method dfaInfeasibleEdge.

/**
     * Get infeasible edges for certain basic block call string
     * @param cfg the CFG containing the block
     * @param block get infeasible outgoing edges for the block
     * @param cs the callstring
     * @return The infeasible edges for this basic block
     */
private List<CFGEdge> dfaInfeasibleEdge(ControlFlowGraph cfg, BasicBlock block, CallString cs) {
    List<CFGEdge> retval = new LinkedList<CFGEdge>();
    if (getDfaLoopBounds() != null) {
        LoopBounds lbs = getDfaLoopBounds();
        Set<FlowEdge> edges = lbs.getInfeasibleEdges(block.getLastInstruction(), cs);
        for (FlowEdge e : edges) {
            BasicBlockNode head = cfg.getHandleNode(e.getHead());
            BasicBlockNode tail = cfg.getHandleNode(e.getTail());
            CFGEdge edge = cfg.getEdge(tail, head);
            if (edge != null) {
                retval.add(edge);
            } else {
            // edge does was removed from the CFG
            // logger.warn("The infeasible edge between "+head+" and "+tail+" does not exist");                	
            }
        }
    }
    return retval;
}
Also used : FlowEdge(com.jopdesign.dfa.framework.FlowEdge) LoopBounds(com.jopdesign.dfa.analyses.LoopBounds) BasicBlockNode(com.jopdesign.common.code.ControlFlowGraph.BasicBlockNode) LinkedList(java.util.LinkedList) CFGEdge(com.jopdesign.common.code.ControlFlowGraph.CFGEdge)

Aggregations

BasicBlockNode (com.jopdesign.common.code.ControlFlowGraph.BasicBlockNode)6 ControlFlowGraph (com.jopdesign.common.code.ControlFlowGraph)4 MethodInfo (com.jopdesign.common.MethodInfo)3 CFGNode (com.jopdesign.common.code.ControlFlowGraph.CFGNode)3 ExecutionContext (com.jopdesign.common.code.ExecutionContext)3 MethodCode (com.jopdesign.common.MethodCode)2 CFGEdge (com.jopdesign.common.code.ControlFlowGraph.CFGEdge)2 LoopBound (com.jopdesign.common.code.LoopBound)2 InstructionHandle (org.apache.bcel.generic.InstructionHandle)2 ClassInfo (com.jopdesign.common.ClassInfo)1 BasicBlock (com.jopdesign.common.code.BasicBlock)1 ContextEdge (com.jopdesign.common.code.CallGraph.ContextEdge)1 InvokeNode (com.jopdesign.common.code.ControlFlowGraph.InvokeNode)1 NodeVisitor (com.jopdesign.common.graphutils.NodeVisitor)1 TopologicalTraverser (com.jopdesign.common.graphutils.TopologicalTraverser)1 LoopBounds (com.jopdesign.dfa.analyses.LoopBounds)1 FlowEdge (com.jopdesign.dfa.framework.FlowEdge)1 BadAnnotationException (com.jopdesign.wcet.annotations.BadAnnotationException)1 SourceAnnotations (com.jopdesign.wcet.annotations.SourceAnnotations)1 IOException (java.io.IOException)1