Class ControlFlowGraphBuilder
- java.lang.Object
-
- com.strobel.assembler.flowanalysis.ControlFlowGraphBuilder
-
public final class ControlFlowGraphBuilder extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ControlFlowGraphBuilder.CopyFinallySubGraphLogic
-
Field Summary
Fields Modifier and Type Field Description private ControlFlowNode
_entryPoint
private ControlFlowNode
_exceptionalExit
private java.util.List<ExceptionHandler>
_exceptionHandlers
private boolean[]
_hasIncomingJumps
private java.util.List<Instruction>
_instructions
private int
_nextBlockId
private java.util.List<ControlFlowNode>
_nodes
private int[]
_offsets
private ControlFlowNode
_regularExit
(package private) boolean
copyFinallyBlocks
-
Constructor Summary
Constructors Modifier Constructor Description private
ControlFlowGraphBuilder(java.util.List<Instruction> instructions, java.util.List<ExceptionHandler> exceptionHandlers)
-
Method Summary
-
-
-
Field Detail
-
_instructions
private final java.util.List<Instruction> _instructions
-
_exceptionHandlers
private final java.util.List<ExceptionHandler> _exceptionHandlers
-
_nodes
private final java.util.List<ControlFlowNode> _nodes
-
_offsets
private final int[] _offsets
-
_hasIncomingJumps
private final boolean[] _hasIncomingJumps
-
_entryPoint
private final ControlFlowNode _entryPoint
-
_regularExit
private final ControlFlowNode _regularExit
-
_exceptionalExit
private final ControlFlowNode _exceptionalExit
-
_nextBlockId
private int _nextBlockId
-
copyFinallyBlocks
boolean copyFinallyBlocks
-
-
Constructor Detail
-
ControlFlowGraphBuilder
private ControlFlowGraphBuilder(java.util.List<Instruction> instructions, java.util.List<ExceptionHandler> exceptionHandlers)
-
-
Method Detail
-
build
public static ControlFlowGraph build(MethodBody methodBody)
-
build
public static ControlFlowGraph build(java.util.List<Instruction> instructions, java.util.List<ExceptionHandler> exceptionHandlers)
-
build
public final ControlFlowGraph build()
-
calculateIncomingJumps
private void calculateIncomingJumps()
-
createNodes
private void createNodes()
-
createRegularControlFlow
private void createRegularControlFlow()
-
createExceptionalControlFlow
private void createExceptionalControlFlow()
-
createBranchControlFlow
private void createBranchControlFlow(ControlFlowNode node, Instruction jump, Instruction target)
-
createReturnControlFlow
private void createReturnControlFlow(ControlFlowNode node, Instruction end)
-
transformLeaveEdges
private void transformLeaveEdges()
-
copyFinallyBlocksIntoLeaveEdges
private void copyFinallyBlocksIntoLeaveEdges()
-
copyFinallySubGraph
private ControlFlowNode copyFinallySubGraph(ControlFlowNode start, ControlFlowNode end, ControlFlowNode newEnd)
-
isNarrower
private static boolean isNarrower(ExceptionHandler handler, ExceptionHandler anchor)
-
isNarrower
private static boolean isNarrower(InstructionBlock block, InstructionBlock anchor)
-
findParentExceptionHandlerNode
private ControlFlowNode findParentExceptionHandlerNode(ControlFlowNode node)
-
findInnermostExceptionHandlerNode
private ControlFlowNode findInnermostExceptionHandlerNode(int offset)
-
findInnermostFinallyHandlerNode
private ControlFlowNode findInnermostFinallyHandlerNode(int offset)
-
getInstructionIndex
private int getInstructionIndex(Instruction instruction)
-
findNode
private ControlFlowNode findNode(Instruction instruction)
-
findInnermostExceptionHandler
private ExceptionHandler findInnermostExceptionHandler(int offsetInTryBlock)
-
findInnermostFinallyHandler
private ExceptionHandler findInnermostFinallyHandler(int offsetInTryBlock)
-
findInnermostHandlerBlock
private ControlFlowNode findInnermostHandlerBlock(int instructionOffset)
-
findInnermostFinallyBlock
private ControlFlowNode findInnermostFinallyBlock(int instructionOffset)
-
findInnermostHandlerBlock
private ControlFlowNode findInnermostHandlerBlock(int instructionOffset, boolean finallyOnly)
-
createEdge
private ControlFlowEdge createEdge(ControlFlowNode fromNode, Instruction toInstruction, JumpType type)
-
createEdge
private ControlFlowEdge createEdge(ControlFlowNode fromNode, ControlFlowNode toNode, JumpType type)
-
coalesceExceptionHandlers
private static java.util.List<ExceptionHandler> coalesceExceptionHandlers(java.util.List<ExceptionHandler> handlers)
-
-