Class ControlFlowGraph
- java.lang.Object
-
- org.apache.bcel.verifier.structurals.ControlFlowGraph
-
public class ControlFlowGraph extends java.lang.Object
This class represents a control flow graph of a method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ControlFlowGraph.InstructionContextImpl
Objects of this class represent a node in a ControlFlowGraph.
-
Field Summary
Fields Modifier and Type Field Description private ExceptionHandlers
exceptionhandlers
The ExceptionHandlers object for the method whose control flow is represented by this ControlFlowGraph.private java.util.Map<InstructionHandle,InstructionContext>
instructionContexts
All InstructionContext instances of this ControlFlowGraph.private Subroutines
subroutines
The Subroutines object for the method whose control flow is represented by this ControlFlowGraph.
-
Constructor Summary
Constructors Constructor Description ControlFlowGraph(MethodGen methodGen)
A Control Flow Graph; with additional JustIce checksControlFlowGraph(MethodGen methodGen, boolean enableJustIceCheck)
A Control Flow Graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstructionContext
contextOf(InstructionHandle inst)
Returns the InstructionContext of a given instruction.InstructionContext[]
contextsOf(InstructionHandle[] insts)
Returns the InstructionContext[] of a given InstructionHandle[], in a naturally ordered manner.InstructionContext[]
getInstructionContexts()
Returns an InstructionContext[] with all the InstructionContext instances for the method whose control flow is represented by this ControlFlowGraph (NOT ORDERED!).boolean
isDead(InstructionHandle i)
Returns true, if and only if the said instruction is not reachable; that means, if it is not part of this ControlFlowGraph.
-
-
-
Field Detail
-
subroutines
private final Subroutines subroutines
The Subroutines object for the method whose control flow is represented by this ControlFlowGraph.
-
exceptionhandlers
private final ExceptionHandlers exceptionhandlers
The ExceptionHandlers object for the method whose control flow is represented by this ControlFlowGraph.
-
instructionContexts
private final java.util.Map<InstructionHandle,InstructionContext> instructionContexts
All InstructionContext instances of this ControlFlowGraph.
-
-
Constructor Detail
-
ControlFlowGraph
public ControlFlowGraph(MethodGen methodGen)
A Control Flow Graph; with additional JustIce checks- Parameters:
methodGen
- the method generator instance
-
ControlFlowGraph
public ControlFlowGraph(MethodGen methodGen, boolean enableJustIceCheck)
A Control Flow Graph.- Parameters:
methodGen
- the method generator instanceenableJustIceCheck
- if true, additional JustIce checks are performed- Since:
- 6.0
-
-
Method Detail
-
contextOf
public InstructionContext contextOf(InstructionHandle inst)
Returns the InstructionContext of a given instruction.
-
contextsOf
public InstructionContext[] contextsOf(InstructionHandle[] insts)
Returns the InstructionContext[] of a given InstructionHandle[], in a naturally ordered manner.
-
getInstructionContexts
public InstructionContext[] getInstructionContexts()
Returns an InstructionContext[] with all the InstructionContext instances for the method whose control flow is represented by this ControlFlowGraph (NOT ORDERED!).
-
isDead
public boolean isDead(InstructionHandle i)
Returns true, if and only if the said instruction is not reachable; that means, if it is not part of this ControlFlowGraph.
-
-