| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.core.units.code.controlflow.BasicBlock<InsnType extends com.pnfsoftware.jeb.core.units.code.ILocatedInstruction> |
This class represents a basic block of generic instructions.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
BasicBlock()
Create a new empty basic block.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
add(InsnType insn)
DANGEROUS! Append an instruction to the block. | ||||||||||
| int |
allinsize()
Get the number of regular and irregular input edges to this block.
| ||||||||||
| int |
alloutsize()
Get the number of regular and irregular output edges from this node.
| ||||||||||
| InsnType |
get(int index)
Get the instruction at the specified offset.
| ||||||||||
| List<BasicBlock<InsnType>> |
getAllInputBlocks()
Get regular and irregular input blocks.
| ||||||||||
| List<BasicBlock<InsnType>> |
getAllOutputBlocks()
Get regular and irregular output blocks.
| ||||||||||
| BasicBlock<InsnType> |
getInputBlock(int index)
Get a regular input block.
| ||||||||||
| List<BasicBlock<InsnType>> |
getInputBlocks()
Get regular input blocks.
| ||||||||||
| List<InsnType> |
getInstructions()
Get a (copy) list of instructions that make up this basic block.
| ||||||||||
| List<BasicBlock<InsnType>> |
getIrregularInputBlocks()
Get irregular input blocks.
| ||||||||||
| List<BasicBlock<InsnType>> |
getIrregularOutputBlocks()
Get irregular output blocks.
| ||||||||||
| InsnType |
getLast()
Get the last instruction of the block.
| ||||||||||
| BasicBlock<InsnType> |
getOutputBlock(int index)
Get a regular output block.
| ||||||||||
| List<BasicBlock<InsnType>> |
getOutputBlocks()
Get regular output blocks.
| ||||||||||
| int |
insize()
Get the number of regular input edges to this block.
| ||||||||||
| int |
irrinsize()
Get the number of irregular input edges from this node.
| ||||||||||
| int |
irroutsize()
Get the number of irregular output edges from this node.
| ||||||||||
| boolean |
isEmpty()
Determine if the block has 0 instruction.
| ||||||||||
| boolean |
isInfiniteLoop()
Check if the block has a single regular out-edge which points to itself.
| ||||||||||
| boolean |
isSelfReferencing()
Check if the block has at least one regular out-edge pointing to itself.
| ||||||||||
| int |
outsize()
Get the number of regular output edges from this node.
| ||||||||||
| boolean |
remove(int index)
DANGEROUS! Remove an instruction from the block. | ||||||||||
| int |
size()
Get the number of instructions in the block.
| ||||||||||
| String | toString() | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a new empty basic block.
DANGEROUS! Append an instruction to the block.
The instruction is appended to the block. The edges are not updated.
The caller is solely responsible for maintaining the consistency of the block and of the CFG.
| insn | the instruction to be appended |
|---|
Get the number of regular and irregular input edges to this block.
Get the number of regular and irregular output edges from this node.
Get the instruction at the specified offset.
Get a (copy) list of instructions that make up this basic block.
Get the last instruction of the block.
Get the number of regular input edges to this block.
Get the number of irregular input edges from this node.
Get the number of irregular output edges from this node.
Determine if the block has 0 instruction.
Check if the block has a single regular out-edge which points to itself.
Check if the block has at least one regular out-edge pointing to itself.
Get the number of regular output edges from this node.
DANGEROUS! Remove an instruction from the block.
This method may have the nasty side-effect of making the block empty. In that case, it returns true, and it is the caller's responsibility to refresh the CFG at their earliest convenience.
Another issue the client needs to take care of is the removal of the last instruction, which should only happen on very specific conditions, since the trailing instruction typically conditions the out-edges of the block.
Get the number of instructions in the block.