|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.BetterCFGBuilder2.Subroutine
private class BetterCFGBuilder2.Subroutine
JSR subroutine. The top level subroutine is where execution starts. Each subroutine has its own CFG. Eventually, all JSR subroutines will be inlined into the top level subroutine, resulting in an accurate CFG for the overall method.
Field Summary | |
---|---|
private java.util.IdentityHashMap<org.apache.bcel.generic.InstructionHandle,BasicBlock> |
blockMap
|
private CFG |
cfg
|
private java.util.IdentityHashMap<BasicBlock,java.util.List<BetterCFGBuilder2.EscapeTarget>> |
escapeTargetListMap
|
private java.util.BitSet |
exitBlockSet
|
private java.util.BitSet |
instructionSet
|
private java.util.BitSet |
returnBlockSet
|
private org.apache.bcel.generic.InstructionHandle |
start
|
private java.util.BitSet |
unhandledExceptionBlockSet
|
private java.util.LinkedList<BetterCFGBuilder2.WorkListItem> |
workList
|
Constructor Summary | |
---|---|
BetterCFGBuilder2.Subroutine(org.apache.bcel.generic.InstructionHandle start)
Constructor. |
Method Summary | |
---|---|
void |
addEdge(BasicBlock sourceBlock,
BasicBlock destBlock,
int edgeType)
Add an edge to the subroutine's CFG. |
void |
addEdgeAndExplore(BasicBlock sourceBlock,
org.apache.bcel.generic.InstructionHandle target,
int edgeType)
Add a control flow edge to the subroutine. |
void |
addInstruction(org.apache.bcel.generic.InstructionHandle handle)
Add an instruction to the subroutine. |
void |
addItem(BetterCFGBuilder2.WorkListItem item)
Add a work list item for a basic block to be constructed. |
BasicBlock |
allocateBasicBlock()
Allocate a new basic block in the subroutine. |
boolean |
containsInstruction(org.apache.bcel.generic.InstructionHandle handle)
Is the given instruction part of this subroutine? |
java.util.Iterator<BetterCFGBuilder2.EscapeTarget> |
escapeTargetIterator(BasicBlock sourceBlock)
Get an Iterator over the EscapeTargets of given basic block. |
BasicBlock |
getBlock(org.apache.bcel.generic.InstructionHandle start)
Get the basic block in the subroutine for the given instruction. |
CFG |
getCFG()
Get the subroutine's CFG. |
BasicBlock |
getEntry()
Get the entry block for the subroutine's CFG. |
BasicBlock |
getExit()
Get the exit block for the subroutine's CFG. |
BasicBlock |
getStartBlock()
Get the start block for the subroutine's CFG. |
org.apache.bcel.generic.InstructionHandle |
getStartInstruction()
Get the start instruction. |
boolean |
hasMoreWork()
Are there more work list items? |
boolean |
isExitBlock(BasicBlock block)
Is System.exit() called at the end of this block? |
boolean |
isReturnBlock(BasicBlock block)
Does the method return at the end of this block? |
boolean |
isUnhandledExceptionBlock(BasicBlock block)
Does this block throw an unhandled exception? |
BetterCFGBuilder2.WorkListItem |
nextItem()
Get the next work list item. |
void |
setExitBlock(BasicBlock block)
Indicate that System.exit() is called at the end of the given block. |
void |
setReturnBlock(BasicBlock block)
Indicate that the method returns at the end of the given block. |
void |
setUnhandledExceptionBlock(BasicBlock block)
Indicate that an unhandled exception may be thrown by the given block. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final org.apache.bcel.generic.InstructionHandle start
private final java.util.BitSet instructionSet
private final CFG cfg
private java.util.IdentityHashMap<org.apache.bcel.generic.InstructionHandle,BasicBlock> blockMap
private java.util.IdentityHashMap<BasicBlock,java.util.List<BetterCFGBuilder2.EscapeTarget>> escapeTargetListMap
private java.util.BitSet returnBlockSet
private java.util.BitSet exitBlockSet
private java.util.BitSet unhandledExceptionBlockSet
private java.util.LinkedList<BetterCFGBuilder2.WorkListItem> workList
Constructor Detail |
---|
public BetterCFGBuilder2.Subroutine(org.apache.bcel.generic.InstructionHandle start)
start
- the start instruction for the subroutineMethod Detail |
---|
public org.apache.bcel.generic.InstructionHandle getStartInstruction()
public BasicBlock allocateBasicBlock()
public void addItem(BetterCFGBuilder2.WorkListItem item)
public boolean hasMoreWork()
public BetterCFGBuilder2.WorkListItem nextItem()
public BasicBlock getEntry()
public BasicBlock getExit()
public BasicBlock getStartBlock()
public CFG getCFG()
public void addInstruction(org.apache.bcel.generic.InstructionHandle handle) throws CFGBuilderException
handle
- the instruction to be added to the subroutine
CFGBuilderException
public boolean containsInstruction(org.apache.bcel.generic.InstructionHandle handle)
public BasicBlock getBlock(org.apache.bcel.generic.InstructionHandle start)
start
- the start instruction for the block
public void setReturnBlock(BasicBlock block)
block
- the returning blockpublic boolean isReturnBlock(BasicBlock block)
public void setExitBlock(BasicBlock block)
block
- the exiting blockpublic boolean isExitBlock(BasicBlock block)
public void setUnhandledExceptionBlock(BasicBlock block)
block
- the block throwing an unhandled exceptionpublic boolean isUnhandledExceptionBlock(BasicBlock block)
public void addEdgeAndExplore(BasicBlock sourceBlock, org.apache.bcel.generic.InstructionHandle target, int edgeType)
sourceBlock
- the source basic blocktarget
- the control targetedgeType
- the type of control edgepublic void addEdge(BasicBlock sourceBlock, BasicBlock destBlock, int edgeType)
sourceBlock
- the source basic blockdestBlock
- the destination basic blockedgeType
- the type of edgepublic java.util.Iterator<BetterCFGBuilder2.EscapeTarget> escapeTargetIterator(BasicBlock sourceBlock)
sourceBlock
- the basic block
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |