java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.asm.cfg.DFA<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
Data Flow Analysis (DFA) object for a CFG
.
DFA objects can be configured and performed using CFG.doDataFlowAnalysis()
methods.
Important: The provided chains are ordered by key (variable) appearance in processing.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | DFA.BI<InsnType extends IInstruction> |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
<T extends Number> String |
formatChain(Map<Integer, Set<T>> chains)
Format a data chain as:
(regId)={pos0, pos1, ...} ... | ||||||||||
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, Set<Integer>> | getDefUseChains(BasicBlock<InsnType> b, int index) | ||||||||||
Map<Integer, Set<Long>> |
getDefUseChains(long address)
Retrieve the du-chains for the instruction at the provided address.
| ||||||||||
long | getExecutionTime() | ||||||||||
Map<Integer, Set<Long>> | getFullDefUseChains(BasicBlock<InsnType> b, int index) | ||||||||||
Map<Integer, Set<Long>> | getFullUseDefChains(BasicBlock<InsnType> b, int index) | ||||||||||
Map<Integer, Set<Long>> |
getInputMap()
Retrieve the du-chain of live registers at the entry block.
| ||||||||||
Map<Integer, Set<Long>> |
getOutputMap()
Retrieve a coalesced ud-chain of reaching registers for all the exit blocks of the CFG.
| ||||||||||
Map<Integer, Set<Long>> | getOutputMap(BasicBlock<InsnType> b) | ||||||||||
Map<Integer, Set<Long>> |
getOutputMap(long lastAddress)
Retrieve the ud-chain of reaching registers for the provided exit block.
| ||||||||||
Map<Integer, Set<Long>> |
getReachingVariables(long address)
Retrieve the list of variables reaching the instruction at the provided address.
| ||||||||||
Map<Integer, Set<Integer>> | getUseDefChains(BasicBlock<InsnType> b, int index) | ||||||||||
Map<Integer, Set<Long>> |
getUseDefChains(long address)
Retrieve the ud-chains for the instruction at the provided address.
| ||||||||||
List<Integer> |
getUseDiscrepancies(long address)
Retrieve the list of use-discrepancies at the provided address.
| ||||||||||
int |
getVariableCollectionFlags()
Retrieve the variable collection flags.
| ||||||||||
IVariableInformationProvider | getVariableInformationProvider() | ||||||||||
void |
invalidate()
Invalidate the analysis.
| ||||||||||
boolean | isCleanCopies() | ||||||||||
boolean |
isConservative()
Convenience method used to determine whether the variable collection flags are
CONSERVATIVE . | ||||||||||
boolean | isIntegrateCalculatedInputRegisters() | ||||||||||
boolean |
isNotRedefined(int varid, BasicBlock<InsnType> b0, int i0, BasicBlock<InsnType> b1, int i1)
Determine if a variable reaching an instruction at a start instruction has not been redefined when it
reaches an final instruction.
| ||||||||||
boolean |
isNotRedefined(int varid, long addr0, long addr1)
Determine if a variable reaching an instruction at a start instruction has not been redefined when it
reaches an final instruction.
| ||||||||||
boolean | isSanitizePotentialLists() | ||||||||||
boolean |
isValid()
Determine whether the current analysis was performed and is valid.
| ||||||||||
void |
perform()
Perform data flow analysis on the CFG.
| ||||||||||
void | removeEntries(BasicBlock<InsnType> b, int index, boolean hardRemoval) | ||||||||||
void | setCleanCopies(boolean cleanCopies) | ||||||||||
void |
setConservative(boolean conservative)
Convenience method used to set or remove
CONSERVATIVE variable collection
flags. | ||||||||||
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.code.IDataFlowAnalysis
|
Format a data chain as: (regId)={pos0, pos1, ...} ...
. The ids are naturally
ordered. Positions for each id are also naturally ordered. Consequently, performing chain
comparison using string comparison on the rendered chain is a viable solution.
chains | chain |
---|
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 done 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 done else this method will throw an IllegalStateException.
Retrieve the ud-chain of reaching registers for the provided exit block.
Data flow analysis must have been #doDataFlowAnalysis() performed done else this method will throw an IllegalStateException.
lastAddress | address of the last instruction of the wanted output block |
---|
Retrieve the list of variables reaching the instruction at the provided address.
Data flow analysis must have been #doDataFlowAnalysis() performed done 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 done 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 address.
Data flow analysis must have been #doDataFlowAnalysis() performed done else this method will throw an IllegalStateException.
address | (-1L is not a valid address for this method) |
---|
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.
Convenience method used to determine whether the variable collection flags are
CONSERVATIVE
.
Determine if a variable reaching an instruction at a start instruction has not been redefined when it reaches an 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.)
Data flow analysis must have been #doDataFlowAnalysis() performed done else this method will throw an IllegalStateException.
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 exlusive |
Determine if a variable reaching an instruction at a start instruction has not been redefined when it reaches an 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.)
Data flow analysis must have been #doDataFlowAnalysis() performed done else this method will throw an IllegalStateException.
varid | variable id |
---|---|
addr0 | start address, exclusive |
addr1 | final address, also exclusive |
Determine whether the current analysis was performed and is valid.
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.
Convenience method used to set or remove CONSERVATIVE
variable collection
flags.
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 |
---|