|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoins.flow.DataFlowImpl
Implementation of the DataFlow interface.
There are some dependencies between the methods in this class.
For example, findReach() mustn't be called before both findDef() and findKill() have been called,
and findKill() in turn depends on the result of findDefined().
Access restrictions (or the like) that reflect these dependencies are not yet implemented. Please be careful in using.
findAll() method calls these methods in the correct order.
| Field Summary | |
protected DefVector |
DEF_INVERTED
|
protected DefVector |
DEF_ZERO
|
protected ExpVector |
EXP_INVERTED
|
protected ExpVector |
EXP_ZERO
|
int |
fDbgFlow
|
protected int |
fDefCount
|
protected int[] |
fDefNodeIndexTable
|
protected FlowAnalSym[] |
fFlowAnalSymTable
|
Flow |
flow
|
FlowRoot |
flowRoot
|
protected RecordAlias |
fRecordAlias
|
protected ShowDataFlow |
fShowDataFlow
|
protected SubpFlow |
fSubpFlow
|
protected java.util.Set[] |
fUndefinedUseNodesOfSym
|
HirRoot |
hirRoot
|
IoRoot |
ioRoot
|
ShowDataFlowByName |
showDataFlowByName
|
SymRoot |
symRoot
|
| Constructor Summary | |
DataFlowImpl()
|
|
DataFlowImpl(FlowRoot pFlowRoot,
SubpFlow pSubpFlow)
Constructs a DataFlow instance and prepares for DFA. |
|
| Method Summary | |
protected void |
addEGenExpId(java.util.Set pEGenSet,
java.util.Set pEKillSet,
SetRefRepr pSetRefRepr)
addEGenExpId EGen computation by using ExpId. |
protected void |
allocateSpace()
allocateSpace Allocates space to store BitVector instances for the entire flow. |
protected java.util.Set |
callModSyms(IR pCallNode,
SubpFlow pCurrentSubpFlow)
|
void |
clean()
Cleans the environment that may contain junk information for the current DFA. |
int |
defLookup(int pNodeIndex)
Changes the IR node index into the "Def" index. |
int |
defReverseLookup(int pBitPosition)
Changes the "Def" index into the IR node index. |
int |
expLookup(int pExpIdIndex)
Changes the ExpId index into the position in the ExpVector. |
int |
expReverseLookup(int pBitPosition)
Changes the position in the ExpVector into the ExpId index. |
void |
findAll()
Finds and sets all the data flow information. |
void |
findAllBitVectors()
Finds and sets all the BitVectors, that is, Def, Kill, In, Out, Reach, Defined, Exposed, EGen, EKill, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors. |
void |
findAvailInAvailOut()
Finds and sets the AvailIn and AvailOut vectors from the EGen and EKill vectors using the data flow equations. |
void |
findBasic()
Finds and sets the data flow items that are independent of the control flow, that is, Def, Kill, Defined, Exposed, EGen, and EKill vectors. |
void |
findDef()
Finds and sets the Def vectors for the entire flow. |
void |
findDef(BBlock pBBlock)
Finds and sets the Def vector for the given BBlock. |
void |
findDefInDefOut()
Finds and sets the DefIn and DefOut vectors from the Defined vectors using the data flow equations. |
void |
findDefined()
Finds and sets the Defined vectors for the entire flow. |
void |
findDefined(BBlock pBBlock)
Finds and sets the Defined vector for the given BBlock. |
void |
findDefUse()
Finds and sets the DefUseList for each FlowAnalSym without considering side effects of call and alias. |
void |
findDefUseExhaustively()
Finds and sets the DefUseList for each FlowAnalSym considering side effects of call and alias. |
void |
findEGen()
Finds and sets the EGen vectors for the entire flow. |
void |
findEGen(BBlock pBBlock)
Finds and sets the EGen vector for the given BBlock. |
void |
findEKill()
Finds and sets the EKill vectors for the entire flow. |
void |
findEKill(BBlock pBBlock)
Finds and sets the EGen vector for the given BBlock. |
void |
findExposed()
Finds and sets the Exposed vectors for the entire flow. |
void |
findExposed(BBlock pBBlock)
Finds and sets the Exposed vector for the given BBlock. |
void |
findKill()
Finds and sets the Kill vectors for the entire flow. |
void |
findKill(BBlock pBBlock)
Finds and sets the Kill vector for the given BBlock using the Defined vector for that BBlock. |
void |
findLiveInLiveOut()
Finds and sets the LiveIn and LiveOut vectors from the Exposed and Defined vectors using the data flow equations. |
void |
findReach()
Finds and sets the Reach vectors from the Def and Kill vectors using the data flow equations. |
void |
findUsed()
Finds and sets the Used vectors for the entire flow. |
void |
findUsed(BBlock pBBlock)
Finds and sets the Used vector for the given BBlock. |
void |
findUseDef()
Find UseDef relations and DefUse relations without considering side effects of call and alias. |
protected void |
findUseDef(BBlock pBBlock,
boolean pExhaustive)
findUseDef Compute both DefUse relations and UseDef relations for pBBlock. |
void |
findUseDefExhaustively()
Find UseDef relations and DefUse relations considering side effects of call and alias. |
java.util.List |
getBBlockList()
Returns the List of BBlocks in the flow. |
int |
getDefCount()
getDefCount |
int |
getDefIndex(int NodeIndex)
getDefIndex |
int |
getDefNodeIndex(int pDefSetRefReprNo)
getNodeIndex |
FlowAnalSym |
getFlowAnalSym(int ExpIndex)
getExpId |
int |
getFlowAnalSymCount()
// getExpIdCount getFlowAnalSymCount |
IR |
getNode(int pNodeIndex)
getNode(int) Returns the node that has the given index. |
IR |
getNodeFromDefIndex(int pDefIndex)
Returns the IR node that corresponds to the given DefSetRefRepr index (entry of the DefVector). |
int |
getPointCount()
getPointCount |
java.util.Set |
getUndefinedUseNodeOfSym(FlowAnalSym lSym)
|
java.util.Set |
getUseFlowAnalSyms(FlowAnalSym pFlowAnalSym)
Returns the Set of ExpIds that are contained in the given ExpId and are used. |
java.util.Set |
getUseFlowAnalSyms(IR pSubtree)
!!HIR Returns the Set of ExpIds that fall under the given subtree and are used. |
java.util.Set |
getUseFlowAnalSymsForHir(HIR pSubtree)
|
protected void |
handleCall(IR pCallNode,
SubpFlow pSubpFlow,
java.util.Set pDDefSyms,
ListValuedMap pSymToPDefNode)
findUseDefObsolete Compute both DefUse relations and UseDef relations for pBBlock. |
protected void |
initiateDataFlow()
|
protected void |
recordExpId()
allocateExpId Creates a table that retrieves ExpId from its index value. |
(package private) void |
recordSetRefReprs()
Records the SetRefReprs each BBlock contains. |
void |
showAll()
Shows all the information found in this DFA. |
void |
showAllBitVectors()
Shows all the BitVectors. |
void |
showAvailIn()
Shows the AvailIn vector for every BBlock. |
void |
showAvailInAvailOutRelated()
Shows BitVectors related to (needed to solve) AvailIn/AvailOut vectors, that is, EGen, EKill, AvailIn, and AvailOut vectors. |
void |
showAvailOut()
Shows the AvailOut vector for every BBlock. |
void |
showBasic()
Shows all the data flow items that are independent of the control flow, that is, Def, Kill, Defined, Exposed, EGen, and EKill vectors. |
void |
showDef()
Shows the Def vector for every BBlock. |
void |
showDefIn()
Shows the DefIn vector for every BBlock. |
void |
showDefInDefOutRelated()
Shows BitVectors related to (needed to solve) DefIn/DefOut vectors, that is, Defined, DefIn, and DefOut vectors. |
void |
showDefined()
Shows the Defined vector for every BBlock. |
void |
showDefOut()
Shows the DefOut vector for every BBlock. |
void |
showDefUse()
Shows the DefUseList for each FlowAnalSym. |
void |
showDefVectors()
Shows all the DefVectors for all the BBlocks. |
void |
showEGen()
Shows the EGen vector for every BBlock. |
void |
showEKill()
Shows the EKill vector for every BBlock. |
void |
showExposed()
Shows the Exposed vector for every BBlock. |
void |
showExpVectors()
Shows all the ExpVectors for all the BBlocks. |
void |
showKill()
Shows the Kill vector for every BBlock. |
void |
showLiveIn()
Shows the LiveIn vector for every BBlock. |
void |
showLiveInLiveOutRelated()
Shows BitVectors related to (needed to solve) LiveIn/LiveOut vectors, that is, Exposed, Defined, LiveIn, and LiveOut vectors. |
void |
showLiveOut()
Shows the LiveOut vector for every BBlock. |
void |
showReach()
Shows the Reach vector for every BBlock. |
void |
showReachRelated()
Shows BitVectors related to (needed to solve) Reach vectors, that is, Def, Kill, and Reach vectors. |
void |
showSolved()
Shows all the data flow items data flow equations have found, that is, In, Out, Reach, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors. |
void |
showSummary()
Show summary of data flow information. |
void |
showUseDef()
Shows the UseDefList for each FlowAnalSym. |
(package private) void |
showVector(BitVector pBitVector)
Shows the given BitVector. |
(package private) void |
showVector(BitVector pBitVector,
java.lang.String pComment)
Shows the given BitVector w/ a comment(heading). |
void |
solveAll()
Solves all the data flow equations to find In, Out, Reach, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors. |
(package private) ExpVector |
toExpVector(java.util.Set pSymbolSet)
toExpVector Converts the given Set of symbols to an ExpVector where each bit of the vector corresponds to an element in the Set set. |
(package private) java.util.Set |
toSet(ExpVector pExpVector)
Converts the given ExpVector to a Set that has elements that correspond to the set bits of the ExpVector. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final FlowRoot flowRoot
public final IoRoot ioRoot
public final SymRoot symRoot
public final HirRoot hirRoot
public final Flow flow
public ShowDataFlowByName showDataFlowByName
protected SubpFlow fSubpFlow
protected ShowDataFlow fShowDataFlow
protected int fDefCount
protected DefVector DEF_ZERO
protected DefVector DEF_INVERTED
protected ExpVector EXP_ZERO
protected ExpVector EXP_INVERTED
protected int[] fDefNodeIndexTable
protected FlowAnalSym[] fFlowAnalSymTable
protected java.util.Set[] fUndefinedUseNodesOfSym
protected RecordAlias fRecordAlias
public final int fDbgFlow
| Constructor Detail |
public DataFlowImpl(FlowRoot pFlowRoot,
SubpFlow pSubpFlow)
public DataFlowImpl()
| Method Detail |
protected void initiateDataFlow()
void recordSetRefReprs()
public java.util.List getBBlockList()
getBBlockList in interface DataFlowprotected void recordExpId()
public int getDefCount()
getDefCount in interface DataFlowpublic int getFlowAnalSymCount()
getFlowAnalSymCount in interface DataFlowpublic int getPointCount()
getPointCount in interface DataFlowpublic FlowAnalSym getFlowAnalSym(int ExpIndex)
getFlowAnalSym in interface DataFlowpublic int getDefIndex(int NodeIndex)
getDefIndex in interface DataFlowpublic int getDefNodeIndex(int pDefSetRefReprNo)
getDefNodeIndex in interface DataFlowpDefSetRefReprNo - index of value-setting SetRefRepr.
public IR getNode(int pNodeIndex)
getNode in interface DataFlowpNodeIndex - index of the node to be gotten.
public IR getNodeFromDefIndex(int pDefIndex)
getNodeFromDefIndex in interface DataFlowprotected void allocateSpace()
public void findDef()
findDef in interface DataFlowpublic void findDef(BBlock pBBlock)
findDef in interface DataFlowpBBlock - BBlock whose Def vector to find.public void findKill()
findKill in interface DataFlowpublic void findKill(BBlock pBBlock)
findKill in interface DataFlowpBBlock - BBlock whose Kill vector to find.
See #findDefined()public void findDefined()
findDefined in interface DataFlowpublic void findDefined(BBlock pBBlock)
findDefined in interface DataFlowpBBlock - BBlock whose Defined vector to find.public void findUsed()
findUsed in interface DataFlowpublic void findUsed(BBlock pBBlock)
findUsed in interface DataFlowpBBlock - BBlock whose Used vector to find.public void findExposed()
findExposed in interface DataFlowpublic void findExposed(BBlock pBBlock)
findExposed in interface DataFlowpBBlock - BBlock whose Exposed vector to find.public void findEGen()
findEGen in interface DataFlow
protected void addEGenExpId(java.util.Set pEGenSet,
java.util.Set pEKillSet,
SetRefRepr pSetRefRepr)
pEGenSet - accumulated set of EGen ExpIds in the current BBlock.pEKillSet - accumulated set of EKill ExpIds in the current BBlock.pSetRefRepr - SetRefRepr of an expression.public void findEGen(BBlock pBBlock)
findEGen in interface DataFlowpBBlock - BBlock whose EGen vector to find.public void findEKill()
findEKill in interface DataFlowpublic void findEKill(BBlock pBBlock)
findEKill in interface DataFlowpBBlock - BBlock whose EGen vector to be found.public void findReach()
findReach in interface DataFlowpublic void findAvailInAvailOut()
findAvailInAvailOut in interface DataFlowpublic void findLiveInLiveOut()
findLiveInLiveOut in interface DataFlowpublic void findDefInDefOut()
findDefInDefOut in interface DataFlowpublic int defLookup(int pNodeIndex)
defLookup in interface DataFlowpNodeIndex - index of the value-setting node (AssignStmt in HIR).public int defReverseLookup(int pBitPosition)
defReverseLookup in interface DataFlowpBitPosition - index in the DefVector for which to find the node index.public int expLookup(int pExpIdIndex)
expLookup in interface DataFlowpExpIdIndex - index of ExpId.public int expReverseLookup(int pBitPosition)
expReverseLookup in interface DataFlowpBitPosition - position in the ExpVector.public java.util.Set getUseFlowAnalSyms(IR pSubtree)
getUseFlowAnalSyms in interface DataFlowpSubtree - IR node that is the root of the subtree to examine.
public java.util.Set getUseFlowAnalSymsForHir(HIR pSubtree)
getUseFlowAnalSymsForHir in interface DataFlowpublic java.util.Set getUseFlowAnalSyms(FlowAnalSym pFlowAnalSym)
public void clean()
public void findBasic()
findBasic in interface DataFlowDataFlow.findDef(),
DataFlow.findDefined(),
DataFlow.findKill(),
DataFlow.findExposed(),
DataFlow.findEGen(),
DataFlow.findEKill()public void solveAll()
solveAll in interface DataFlowDataFlow.findReach(),
DataFlow.findAvailInAvailOut(),
DataFlow.findLiveInLiveOut(),
DataFlow.findDefInDefOut()public void findAllBitVectors()
findAllBitVectors in interface DataFlowDataFlow.findBasic(),
DataFlow.solveAll()public void findDefUse()
findDefUse in interface DataFlowpublic void findDefUseExhaustively()
findDefUseExhaustively in interface DataFlowpublic void findUseDef()
findUseDef in interface DataFlowpublic void findUseDefExhaustively()
findUseDefExhaustively in interface DataFlow
protected void findUseDef(BBlock pBBlock,
boolean pExhaustive)
pBBlock -
protected void handleCall(IR pCallNode,
SubpFlow pSubpFlow,
java.util.Set pDDefSyms,
ListValuedMap pSymToPDefNode)
protected java.util.Set callModSyms(IR pCallNode,
SubpFlow pCurrentSubpFlow)
public void findAll()
findAll in interface DataFlowDataFlow.findAllBitVectors(),
DataFlow.findDefUse()public void showDef()
showDef in interface DataFlowpublic void showKill()
showKill in interface DataFlowpublic void showReach()
showReach in interface DataFlowpublic void showDefined()
showDefined in interface DataFlowpublic void showExposed()
showExposed in interface DataFlowpublic void showEGen()
showEGen in interface DataFlowpublic void showEKill()
showEKill in interface DataFlowpublic void showAvailIn()
showAvailIn in interface DataFlowpublic void showAvailOut()
showAvailOut in interface DataFlowpublic void showLiveIn()
showLiveIn in interface DataFlowpublic void showLiveOut()
showLiveOut in interface DataFlowpublic void showDefIn()
showDefIn in interface DataFlowpublic void showDefOut()
showDefOut in interface DataFlowpublic void showDefVectors()
showDefVectors in interface DataFlowDataFlow.showDef(),
//@see #showIn()
//@see #showOut(),
DataFlow.showReach()public void showExpVectors()
showExpVectors in interface DataFlowDataFlow.showDefined(),
DataFlow.showExposed(),
DataFlow.showEGen(),
DataFlow.showEKill(),
DataFlow.showAvailIn(),
DataFlow.showAvailOut(),
DataFlow.showLiveIn(),
DataFlow.showLiveOut(),
DataFlow.showDefIn(),
DataFlow.showDefOut()public void showBasic()
showBasic in interface DataFlowDataFlow.showDef(),
DataFlow.showKill(),
DataFlow.showDefined(),
DataFlow.showExposed(),
DataFlow.showEGen(),
DataFlow.showEKill()public void showSolved()
showSolved in interface DataFlowDataFlow.showReach(),
DataFlow.showAvailIn(),
DataFlow.showAvailOut(),
DataFlow.showLiveIn(),
DataFlow.showLiveOut(),
DataFlow.showDefIn(),
DataFlow.showDefOut()public void showReachRelated()
showReachRelated in interface DataFlowDataFlow.showDef(),
DataFlow.showKill(),
DataFlow.showReach()public void showAvailInAvailOutRelated()
showAvailInAvailOutRelated in interface DataFlowDataFlow.showEGen(),
DataFlow.showEKill(),
DataFlow.showAvailIn(),
DataFlow.showAvailOut()public void showLiveInLiveOutRelated()
showLiveInLiveOutRelated in interface DataFlowDataFlow.showExposed(),
DataFlow.showDefined(),
DataFlow.showLiveIn(),
DataFlow.showLiveOut()public void showDefInDefOutRelated()
showDefInDefOutRelated in interface DataFlowDataFlow.showDefined(),
DataFlow.showDefIn(),
DataFlow.showDefOut()public void showAllBitVectors()
showAllBitVectors in interface DataFlowDataFlow.showDefVectors(),
DataFlow.showExpVectors()public void showDefUse()
showDefUse in interface DataFlowpublic void showUseDef()
showUseDef in interface DataFlowpublic void showAll()
showAll in interface DataFlowDataFlow.showAllBitVectors(),
DataFlow.showDefUse()public void showSummary()
DataFlow
showSummary in interface DataFlowvoid showVector(BitVector pBitVector)
pBitVector - BitVector to display
See ShowDataFlow#showVector()
void showVector(BitVector pBitVector,
java.lang.String pComment)
pBitVector - BitVector to displaypComment - Comment that is displayed before the BitVector
See ShowDataFlow#showVector()public java.util.Set getUndefinedUseNodeOfSym(FlowAnalSym lSym)
getUndefinedUseNodeOfSym in interface DataFlowExpVector toExpVector(java.util.Set pSymbolSet)
java.util.Set toSet(ExpVector pExpVector)
pExpVector - ExpVector to convert.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||