java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.asm.cfg.DFA1<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
Legacy Data Flow Analysis (DFA) object for a CFG
. This class calculates all data flow
information for the entire CFG. It is fast on small- to large-sized routines, but can be slow and
consume large amount of memory for very large routines. The use of the newest DFA2
class
is recommended for most cases.
DFA objects can be configured and performed using CFG.doDataFlowAnalysis()
methods.
The provided chains are ordered by key (variable) appearance in processing.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | DFA1.BI<InsnType extends IInstruction> |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | checkNoUse(long addr, int varid) | ||||||||||
Long | checkSingleDef(long addr, int varid) | ||||||||||
Long | checkSingleSource(long addr, int varid) | ||||||||||
Long | checkSingleUse(long addr, int varid) | ||||||||||
String | formatStats() | ||||||||||
BI<InsnType> | getBlockInfo(BasicBlock<InsnType> b) | ||||||||||
CFG<InsnType> |
getCfg()
Retrieve a reference to the CFG object that will be accessed and modified when performing an
analysis.
| ||||||||||
Map<Integer, Collection<Long>> |
getDefUseChains(long address)
Retrieve the du-chains for the instruction at the provided address.
| ||||||||||
Map<Integer, Collection<Long>> | getDefUseChains(BasicBlock<InsnType> b, int index) | ||||||||||
Collection<Long> | getDefUses(long addr, int varid, int stopCount) | ||||||||||
Collection<Long> | getDefUses(long addr, int varid) | ||||||||||
long | getExecutionTime() | ||||||||||
Collection<Long> | getInputMap(int varid) | ||||||||||
Map<Integer, Collection<Long>> |
getInputMap()
Retrieve the du-chain of live registers at the entry block.
| ||||||||||
Set<Integer> | getInputs() | ||||||||||
List<Integer> | getInstructionAllDefs(long addr) | ||||||||||
List<Integer> | getInstructionAllUses(long addr) | ||||||||||
Collection<Integer> | getInstructionDefs(long addr) | ||||||||||
Collection<Integer> | getInstructionPotentialDefs(long addr) | ||||||||||
Collection<Integer> | getInstructionPotentialUses(long addr) | ||||||||||
Collection<Integer> | getInstructionSpoiledDefs(long addr) | ||||||||||
Collection<Integer> | getInstructionUses(long addr) | ||||||||||
Map<Integer, Collection<Long>> | getLiveChains(BasicBlock<InsnType> b, int idx) | ||||||||||
Collection<Long> | getLiveChains(BasicBlock<InsnType> b, int idx, int varid) | ||||||||||
Map<Integer, Collection<Long>> |
getOutputMap()
Retrieve a coalesced ud-chain of reaching registers for all the exit blocks of the CFG.
| ||||||||||
Map<Integer, Collection<Long>> | getOutputMap(BasicBlock<InsnType> b) | ||||||||||
Collection<Long> | getOutputMap(BasicBlock<InsnType> blk, int varid) | ||||||||||
Collection<Long> | getOutputMap(int varid) | ||||||||||
Collection<Integer> | getOutputs(BasicBlock<InsnType> b) | ||||||||||
Collection<Integer> | getOutputs() | ||||||||||
Map<Integer, Collection<Long>> | getReachChains(BasicBlock<InsnType> b, int idx) | ||||||||||
Collection<Long> | getReachChains(BasicBlock<InsnType> b, int idx, int varid) | ||||||||||
Map<Integer, Collection<Long>> |
getReachingVariables(long address)
Retrieve the list of variables reaching the instruction at the provided address.
| ||||||||||
Map<Integer, Collection<Long>> | getUseDefChains(BasicBlock<InsnType> b, int index) | ||||||||||
Map<Integer, Collection<Long>> |
getUseDefChains(long address)
Retrieve the ud-chains for the instruction at the provided address.
| ||||||||||
Collection<Long> | getUseDefs(long addr, int varid, int stopCount) | ||||||||||
Collection<Long> | getUseDefs(long addr, int varid) | ||||||||||
List<Integer> |
getUseDiscrepancies(long address)
Retrieve the list of use-discrepancies at the provided instruction address.
| ||||||||||
int |
getVariableCollectionFlags()
Retrieve the variable collection flags.
| ||||||||||
IVariableInformationProvider | getVariableInformationProvider() | ||||||||||
void |
invalidate()
Invalidate the analysis.
| ||||||||||
boolean | isCleanCopies() | ||||||||||
boolean | isIntegrateCalculatedInputRegisters() | ||||||||||
boolean |
isNotRedefined(int varid, long addr0, long addr1)
Determine if a variable reaching a start instruction has not been redefined when it reaches a
final instruction.
| ||||||||||
boolean |
isNotRedefined(int varid, BasicBlock<InsnType> b0, int i0, BasicBlock<InsnType> b1, int i1)
Determine if a variable reaching a start instruction has not been redefined when it reaches a
final instruction.
| ||||||||||
boolean | isSanitizePotentialLists() | ||||||||||
boolean | isUseDiscrepancy(long addr, int varid) | ||||||||||
boolean |
isValid()
Determine whether the current analysis was performed and is valid.
| ||||||||||
Boolean |
isVarReachingFromTo(int varid, BasicBlock<InsnType> b0, int i0, BasicBlock<InsnType> b1, int i1)
Determine if a variable used by the start instruction reaches the final instruction with the
same value.
| ||||||||||
Boolean |
isVarReachingFromTo(int varid, long addr0, long addr1)
Determine if a variable used by the start instruction reaches the final instruction with the
same value.
| ||||||||||
void | notifyInstructionUpdate(long addr) | ||||||||||
void |
perform()
Perform data flow analysis on the CFG.
| ||||||||||
void | removeEntries(BasicBlock<InsnType> b, int index, boolean hardRemoval) | ||||||||||
void | setCleanCopies(boolean cleanCopies) | ||||||||||
void | setIntegrateCalculatedInputRegisters(boolean integrateCalculatedInputRegisters) | ||||||||||
void | setSanitizePotentialLists(boolean sanitizePotentialLists) | ||||||||||
void |
setVariableCollectionFlags(int flags)
Set the variable collection flags.
| ||||||||||
void | setVariableInformationProvider(IVariableInformationProvider varInfoProvider) | ||||||||||
String | toString() | ||||||||||
void | verifyDFA() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Retrieve a reference to the CFG object that will be accessed and modified when performing an analysis.
Retrieve the du-chains for the instruction at the provided address.
Data flow analysis must have been #doDataFlowAnalysis() performed else this method will throw an IllegalStateException.
address | instruction address; the special address -1 can be used retrieve the routine's input chains (live registers at entry) |
---|
Retrieve the du-chain of live registers at the entry block.
Data flow analysis must have been #doDataFlowAnalysis() performed else this method will throw an IllegalStateException.
Retrieve a coalesced ud-chain of reaching registers for all the exit blocks of the CFG.
Data flow analysis must have been #doDataFlowAnalysis() performed else this method will throw an IllegalStateException.
Retrieve the list of variables reaching the instruction at the provided address.
Data flow analysis must have been #doDataFlowAnalysis() performed else this method will throw an IllegalStateException.
address | exact instruction address; the special address -1 can be used retrieve the routine's input chains (live registers at entry) |
---|
Retrieve the ud-chains for the instruction at the provided address.
Data flow analysis must have been #doDataFlowAnalysis() performed else this method will throw an IllegalStateException.
address | instruction address; the special address -1 can be used retrieve the routine's output chains (reaching registers at all exits) |
---|
Retrieve the list of use-discrepancies at the provided instruction address.
address | instruction address |
---|
Retrieve the variable collection flags.
DefUseInfo
Invalidate the analysis. Clients have the responsibility to invalidate an analysis if the CFG was modified in such a way that data flow should be recalculated.
Determine if a variable reaching a start instruction has not been redefined when it reaches a final instruction. (Note that this method does not verify that varid actually has definitions reaching the start or final instruction; it is up to the caller to verify that.)
varid | variable id |
---|---|
addr0 | start address, exclusive |
addr1 | final address, also exclusive |
Determine if a variable reaching a start instruction has not been redefined when it reaches a final instruction. (Note that this method does not verify that varid actually has definitions reaching the start or final instruction; it is up to the caller to verify that.)
varid | variable id |
---|---|
b0 | start block |
i0 | final block |
b1 | index of the start instruction in the start block, exclusive |
i1 | index of the final instruction in the final block, also exclusive |
Determine whether the current analysis was performed and is valid.
Determine if a variable used by the start instruction reaches the final instruction with the same value.
varid | variable id |
---|---|
b0 | start block |
i0 | final block |
b1 | index of the start instruction in the start block, exclusive |
i1 | index of the final instruction in the final block, also exclusive |
Determine if a variable used by the start instruction reaches the final instruction with the same value.
varid | variable id |
---|---|
addr0 | start address, exclusive |
addr1 | final address, also exclusive |
Perform data flow analysis on the CFG. Upon return, basic blocks will have their data chains (ud and du, full and simple) set up and accessible.
integrateCalculatedInputRegisters | if true, the live registers determined after analysis will be integrated in the use-def chains |
---|
Set the variable collection flags.
flags | flags, see DefUseInfo
|
---|
IllegalStateException |
---|