Class ControlFlowGraphBuilder
java.lang.Object
com.strobel.assembler.flowanalysis.ControlFlowGraphBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ControlFlowNodeprivate final ControlFlowNodeprivate final List<ExceptionHandler> private final boolean[]private final List<Instruction> private intprivate final List<ControlFlowNode> private final int[]private final ControlFlowNode(package private) boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateControlFlowGraphBuilder(List<Instruction> instructions, List<ExceptionHandler> exceptionHandlers) -
Method Summary
Modifier and TypeMethodDescriptionfinal ControlFlowGraphbuild()static ControlFlowGraphbuild(MethodBody methodBody) static ControlFlowGraphbuild(List<Instruction> instructions, List<ExceptionHandler> exceptionHandlers) private voidprivate static List<ExceptionHandler> coalesceExceptionHandlers(List<ExceptionHandler> handlers) private voidprivate ControlFlowNodecopyFinallySubGraph(ControlFlowNode start, ControlFlowNode end, ControlFlowNode newEnd) private voidcreateBranchControlFlow(ControlFlowNode node, Instruction jump, Instruction target) private ControlFlowEdgecreateEdge(ControlFlowNode fromNode, ControlFlowNode toNode, JumpType type) private ControlFlowEdgecreateEdge(ControlFlowNode fromNode, Instruction toInstruction, JumpType type) private voidprivate voidprivate voidprivate voidcreateReturnControlFlow(ControlFlowNode node, Instruction end) private ExceptionHandlerfindInnermostExceptionHandler(int offsetInTryBlock) private ControlFlowNodefindInnermostExceptionHandlerNode(int offset) private ControlFlowNodefindInnermostFinallyBlock(int instructionOffset) private ExceptionHandlerfindInnermostFinallyHandler(int offsetInTryBlock) private ControlFlowNodefindInnermostFinallyHandlerNode(int offset) private ControlFlowNodefindInnermostHandlerBlock(int instructionOffset) private ControlFlowNodefindInnermostHandlerBlock(int instructionOffset, boolean finallyOnly) private ControlFlowNodefindNode(Instruction instruction) private ControlFlowNodeprivate intgetInstructionIndex(Instruction instruction) private static booleanisNarrower(ExceptionHandler handler, ExceptionHandler anchor) private static booleanisNarrower(InstructionBlock block, InstructionBlock anchor) private void
-
Field Details
-
_instructions
-
_exceptionHandlers
-
_nodes
-
_offsets
private final int[] _offsets -
_hasIncomingJumps
private final boolean[] _hasIncomingJumps -
_entryPoint
-
_regularExit
-
_exceptionalExit
-
_nextBlockId
private int _nextBlockId -
copyFinallyBlocks
boolean copyFinallyBlocks
-
-
Constructor Details
-
ControlFlowGraphBuilder
private ControlFlowGraphBuilder(List<Instruction> instructions, List<ExceptionHandler> exceptionHandlers)
-
-
Method Details
-
build
-
build
public static ControlFlowGraph build(List<Instruction> instructions, List<ExceptionHandler> exceptionHandlers) -
build
-
calculateIncomingJumps
private void calculateIncomingJumps() -
createNodes
private void createNodes() -
createRegularControlFlow
private void createRegularControlFlow() -
createExceptionalControlFlow
private void createExceptionalControlFlow() -
createBranchControlFlow
-
createReturnControlFlow
-
transformLeaveEdges
private void transformLeaveEdges() -
copyFinallyBlocksIntoLeaveEdges
private void copyFinallyBlocksIntoLeaveEdges() -
copyFinallySubGraph
private ControlFlowNode copyFinallySubGraph(ControlFlowNode start, ControlFlowNode end, ControlFlowNode newEnd) -
isNarrower
-
isNarrower
-
findParentExceptionHandlerNode
-
findInnermostExceptionHandlerNode
-
findInnermostFinallyHandlerNode
-
getInstructionIndex
-
findNode
-
findInnermostExceptionHandler
-
findInnermostFinallyHandler
-
findInnermostHandlerBlock
-
findInnermostFinallyBlock
-
findInnermostHandlerBlock
-
createEdge
private ControlFlowEdge createEdge(ControlFlowNode fromNode, Instruction toInstruction, JumpType type) -
createEdge
-
coalesceExceptionHandlers
-