Interface IBasicBlock<InsnType extends IInstruction>
- Type Parameters:
InsnType- instruction type
- All Superinterfaces:
Iterable<InsnType>
- All Known Implementing Classes:
BasicBlock,BasicBlock
Generic interface for CFG's basic block objects.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintGet the total number of input edges to this block.intGet the total number of output edges from this block.booleancanThrow()Determine whether this block can throw an exception.get(int index) Get the instruction at the specified index.longgetAddressOfInstruction(int index) Get the address of an instruction by index.List<? extends IBasicBlock<InsnType>> Get regular and irregular input blocks.Iterable<? extends IBasicBlock<InsnType>> Retrieve a read-only iterable of regular and irregular input blocks.List<? extends IBasicBlock<InsnType>> Get regular and irregular output blocks.Iterable<? extends IBasicBlock<InsnType>> Retrieve a read-only iterable of regular and irregular output blocks.longgetBase()Address of first instruction in the block.longAddress following the last instruction of the block (ie, last exclusive address).longAddress of first instruction in the block.intgetIndexOfInstruction(long address) Get the index of an instruction by address.getInputBlock(int index) Get a regular input block.List<? extends IBasicBlock<InsnType>> Get the regular input blocks.List<? extends IBasicBlock<InsnType>> Retrieve a read-only list of input blocks (regular).getInstruction(long address) Get the instruction located at the exact address.Get a copy of the list of instructions that make up this basic block.getIrregularInputBlock(int index) Get an irregular input block.List<? extends IBasicBlock<InsnType>> Get irregular input blocks.List<? extends IBasicBlock<InsnType>> Retrieve a read-only list of irregular input blocks.getIrregularOutputBlock(int index) Get an irregular output block.List<? extends IBasicBlock<InsnType>> Get irregular output blocks.List<? extends IBasicBlock<InsnType>> Retrieve a read-only list of irregular output blocks.getLast()Get the last instruction of the block.longAddress of last instruction in the block.getOutputBlock(int index) Get a regular output block.List<? extends IBasicBlock<InsnType>> Get the regular output blocks.List<? extends IBasicBlock<InsnType>> Retrieve a read-only list of output blocks (regular).intGet the total size of instructions in the block.intinsize()Get the number of regular input edges to this block.intGet the number of irregular input edges to this block.intGet the number of irregular output edges from this block.booleanisEmpty()Determine if the block has 0 instruction.intoutsize()Get the number of regular output edges from this block.intsize()Get the number of instructions in the block.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getFirstAddress
long getFirstAddress()Address of first instruction in the block.- Returns:
- first instruction address
-
getBase
long getBase()Address of first instruction in the block.- Returns:
- first instruction address
-
getLastAddress
long getLastAddress()Address of last instruction in the block.- Returns:
- last instruction address
-
getEndAddress
long getEndAddress()Address following the last instruction of the block (ie, last exclusive address).- Returns:
- end address
-
isEmpty
boolean isEmpty()Determine if the block has 0 instruction.- Returns:
- true if the block has no instruction
-
size
int size()Get the number of instructions in the block.- Returns:
- instruction count
-
get
Get the instruction at the specified index.- Parameters:
index- instruction index- Returns:
- instruction
-
getLast
InsnType getLast()Get the last instruction of the block.- Returns:
- last instruction
-
getInstructions
Get a copy of the list of instructions that make up this basic block.- Returns:
- instruction list
-
getSizeOfInstructions
int getSizeOfInstructions()Get the total size of instructions in the block.- Returns:
- instruction size
-
getAddressOfInstruction
long getAddressOfInstruction(int index) Get the address of an instruction by index.- Parameters:
index- instruction index- Returns:
- instruction address
-
getIndexOfInstruction
int getIndexOfInstruction(long address) Get the index of an instruction by address.- Parameters:
address- instruction address- Returns:
- -1 if there is no instruction starting at the provided address
-
getInstruction
Get the instruction located at the exact address.- Parameters:
address- instruction address- Returns:
- instruction, or null
-
canThrow
boolean canThrow()Determine whether this block can throw an exception.- Returns:
- true if the block can throw
-
getOutputBlocks
List<? extends IBasicBlock<InsnType>> getOutputBlocks()Get the regular output blocks.- Returns:
- a copy of the list of regular output blocks
-
getOutputBlock
Get a regular output block.- Parameters:
index- block index- Returns:
- output block
-
getIrregularOutputBlocks
List<? extends IBasicBlock<InsnType>> getIrregularOutputBlocks()Get irregular output blocks.- Returns:
- a copy of the list of irregular output blocks
-
getIrregularOutputBlock
Get an irregular output block.- Parameters:
index- block index- Returns:
- irregular output block
-
getAllOutputBlocks
List<? extends IBasicBlock<InsnType>> getAllOutputBlocks()Get regular and irregular output blocks.- Returns:
- a copy of the list of all output blocks
-
getOutputs
List<? extends IBasicBlock<InsnType>> getOutputs()Retrieve a read-only list of output blocks (regular).NOTE: This method is faster than
getOutputBlocks()since it does not provide a copy of the list.- Returns:
- regular output blocks view
-
getIrregularOutputs
List<? extends IBasicBlock<InsnType>> getIrregularOutputs()Retrieve a read-only list of irregular output blocks.NOTE: This method is faster than
getIrregularOutputBlocks()since it does not provide a copy of the list.- Returns:
- irregular output blocks view
-
getAllOutputs
Iterable<? extends IBasicBlock<InsnType>> getAllOutputs()Retrieve a read-only iterable of regular and irregular output blocks.NOTE: This method is faster than
getAllOutputBlocks()since it does not provide a copy of the list.- Returns:
- all output blocks view
-
getInputBlocks
List<? extends IBasicBlock<InsnType>> getInputBlocks()Get the regular input blocks.- Returns:
- a copy of the list of regular input blocks
-
getInputBlock
Get a regular input block.- Parameters:
index- block index- Returns:
- a block
-
getIrregularInputBlocks
List<? extends IBasicBlock<InsnType>> getIrregularInputBlocks()Get irregular input blocks.- Returns:
- a copy of the list of irregular input blocks
-
getIrregularInputBlock
Get an irregular input block.- Parameters:
index- block index- Returns:
- a block
-
getAllInputBlocks
List<? extends IBasicBlock<InsnType>> getAllInputBlocks()Get regular and irregular input blocks.- Returns:
- a copy of the list of all input blocks
-
getInputs
List<? extends IBasicBlock<InsnType>> getInputs()Retrieve a read-only list of input blocks (regular).NOTE: This method is faster than
getInputBlocks()since it does not provide a copy of the list.- Returns:
- regular input blocks view
-
getIrregularInputs
List<? extends IBasicBlock<InsnType>> getIrregularInputs()Retrieve a read-only list of irregular input blocks.NOTE: This method is faster than
getIrregularInputBlocks()since it does not provide a copy of the list.- Returns:
- irregular input blocks view
-
getAllInputs
Iterable<? extends IBasicBlock<InsnType>> getAllInputs()Retrieve a read-only iterable of regular and irregular input blocks.NOTE: This method is faster than
getAllInputBlocks()since it does not provide a copy of the list.- Returns:
- all input blocks view
-
outsize
int outsize()Get the number of regular output edges from this block.- Returns:
- regular output edge count
-
irroutsize
int irroutsize()Get the number of irregular output edges from this block.- Returns:
- irregular output edge count
-
alloutsize
int alloutsize()Get the total number of output edges from this block.- Returns:
- output edge count
-
insize
int insize()Get the number of regular input edges to this block.- Returns:
- regular input edge count
-
irrinsize
int irrinsize()Get the number of irregular input edges to this block.- Returns:
- irregular input edge count
-
allinsize
int allinsize()Get the total number of input edges to this block.- Returns:
- input edge count
-