Package com.ibm.wala.dalvik.classLoader
Class DexCFG.BasicBlock
- java.lang.Object
-
- com.ibm.wala.util.graph.impl.NodeWithNumber
-
- com.ibm.wala.dalvik.classLoader.DexCFG.BasicBlock
-
- All Implemented Interfaces:
IBasicBlock<Instruction>,INodeWithNumber,Iterable<Instruction>
- Enclosing class:
- DexCFG
public final class DexCFG.BasicBlock extends NodeWithNumber implements IBasicBlock<Instruction>
-
-
Constructor Summary
Constructors Constructor Description BasicBlock(int startIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddExceptionalEdges(Instruction last)Add any exceptional edges generated by the last instruction in a basic block.booleanequals(Object o)intgetFirstInstructionIndex()Get the index of the first instruction in the basic block.Collection<TypeReference>getImplicitExceptionTypes(Instruction pei)intgetLastInstructionIndex()Get the index of the last instruction in the basic block.IMethodgetMethod()intgetNumber()Each basic block should have a unique number in its cfginthashCode()booleanisCatchBlock()Return true if the basic block represents a catch block.booleanisEntryBlock()Return true if the basic block represents the unique entry block.booleanisExitBlock()Return true if the basic block represents the unique exit block.Iterator<Instruction>iterator()StringtoString()-
Methods inherited from class com.ibm.wala.util.graph.impl.NodeWithNumber
getGraphNodeId, setGraphNodeId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.ibm.wala.util.graph.INodeWithNumber
getGraphNodeId, setGraphNodeId
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
isCatchBlock
public boolean isCatchBlock()
Description copied from interface:IBasicBlockReturn true if the basic block represents a catch block.- Specified by:
isCatchBlockin interfaceIBasicBlock<Instruction>- Returns:
- true if the basic block represents a catch block.
-
addExceptionalEdges
protected void addExceptionalEdges(Instruction last)
Add any exceptional edges generated by the last instruction in a basic block.- Parameters:
last- the last instruction in a basic block.
-
getImplicitExceptionTypes
public Collection<TypeReference> getImplicitExceptionTypes(Instruction pei)
- Parameters:
pei- a potentially-excepting instruction- Returns:
- the exception types that pei may throw, independent of the class hierarchy. null if none.
Notes
- this method will NOT return the exception type explicitly thrown by an athrow
- this method will NOT return the exception types that a called method may throw
- this method ignores OutOfMemoryError
- this method ignores linkage errors
- this method ignores IllegalMonitorState exceptions
- Throws:
IllegalArgumentException- if pei is null
-
getLastInstructionIndex
public int getLastInstructionIndex()
Description copied from interface:IBasicBlockGet the index of the last instruction in the basic block. The value is an index into the instruction array that contains all the instructions for the method. If the result is < 0, the block has no instructions- Specified by:
getLastInstructionIndexin interfaceIBasicBlock<Instruction>- Returns:
- the instruction index for the last instruction in the basic block
-
getFirstInstructionIndex
public int getFirstInstructionIndex()
Description copied from interface:IBasicBlockGet the index of the first instruction in the basic block. The value is an index into the instruction array that contains all the instructions for the method. If the result is < 0, the block has no instructions- Specified by:
getFirstInstructionIndexin interfaceIBasicBlock<Instruction>- Returns:
- the instruction index for the first instruction in the basic block.
-
isExitBlock
public boolean isExitBlock()
Description copied from interface:IBasicBlockReturn true if the basic block represents the unique exit block.- Specified by:
isExitBlockin interfaceIBasicBlock<Instruction>- Returns:
- true if the basic block represents the unique exit block.
-
isEntryBlock
public boolean isEntryBlock()
Description copied from interface:IBasicBlockReturn true if the basic block represents the unique entry block.- Specified by:
isEntryBlockin interfaceIBasicBlock<Instruction>- Returns:
- true if the basic block represents the unique entry block.
-
getMethod
public IMethod getMethod()
- Specified by:
getMethodin interfaceIBasicBlock<Instruction>- Returns:
- governing method for this block
-
getNumber
public int getNumber()
Description copied from interface:IBasicBlockEach basic block should have a unique number in its cfg- Specified by:
getNumberin interfaceIBasicBlock<Instruction>- Returns:
- the basic block's number
-
iterator
public Iterator<Instruction> iterator()
- Specified by:
iteratorin interfaceIterable<Instruction>
-
-