Constructs the control flow graph for a given method.
Constructs the control flow graph for a given method.
The constructed CFG basically consists of the code's basic blocks. Additionally, two artifical exit nodes are added. One artificial exit node is added to facilitate the navigation to all normal return instructions. A second artificial node is added that enables the navigation to all instructions that led to an abnormal return. Exception handlers are directly added to the graph using CatchNodes. Each exception handler is associated with exactly one CatchNode and all instructions that may throw a corresponding exception will have the respective CatchNode as a successor.
The class hierarchy that will be used to determine if a certain exception is potentially handled by an exception handler.
The code is parsed linearly and the graph is therefore constructed implicitly. Hence, it is possible that the graph contains nodes that cannot be reached from the start node.
,The algorithm supports all Java bytecode instructions - in particular JSR/RET.
A factory for computing control flow graphs for methods.