Package com.ibm.wala.demandpa.alg
Class DemandRefinementPointsTo.PointsToComputer
- java.lang.Object
-
- com.ibm.wala.demandpa.alg.DemandRefinementPointsTo.PointsToComputer
-
- Direct Known Subclasses:
DemandRefinementPointsTo.FlowsToComputer
- Enclosing class:
- DemandRefinementPointsTo
protected class DemandRefinementPointsTo.PointsToComputer extends java.lang.Object
Points-to analysis algorithm code.Pseudocode in Chapter 5 of Manu Sridharan's dissertation.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.ibm.wala.util.intset.OrdinalSetMapping<InstanceKeyAndState>
ikAndStates
for numberingInstanceKey
,StateMachine.State
pairsprotected java.util.Map<PointerKeyAndState,com.ibm.wala.util.intset.MutableIntSet>
pkToP2Set
protected java.util.Map<PointerKeyAndState,com.ibm.wala.util.intset.MutableIntSet>
pkToTrackedSet
protected PointerKeyAndState
queriedPkAndState
-
Constructor Summary
Constructors Modifier Constructor Description protected
PointsToComputer()
use this with care! only for subclasses that aren't computing points-to information exactly (e.g.,DemandRefinementPointsTo.FlowsToComputer
)protected
PointsToComputer(PointerKeyAndState pkAndState)
protected
PointsToComputer(PointerKey pk)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
addAllToP2Set(java.util.Map<PointerKeyAndState,com.ibm.wala.util.intset.MutableIntSet> p2setMap, PointerKeyAndState pkAndState, com.ibm.wala.util.intset.IntSet vals, IFlowLabel label)
protected void
addToTrackedPToWorklist(PointerKeyAndState pkAndState)
protected boolean
calleeSubGraphMissingAndShouldNotBeAdded(boolean addGraphs, CGNode callee, PointerKeyAndState pkAndState)
when doing backward interprocedural propagation, is it true that we should not add a graph representation for a callee _and_ that the subgraph for the callee is missing?protected void
compute()
protected <K> com.ibm.wala.util.intset.MutableIntSet
find(java.util.Map<K,com.ibm.wala.util.intset.MutableIntSet> M, K key)
protected <K> com.ibm.wala.util.intset.MutableIntSet
findOrCreate(java.util.Map<K,com.ibm.wala.util.intset.MutableIntSet> M, K key)
java.util.Collection<InstanceKeyAndState>
getComputedP2Set(PointerKeyAndState queried)
get a points-to set that has already been computed via some previous call tocompute()
; does _not_ do any fresh demand-driven computation.protected void
handleBackCopy(PointerKeyAndState curPkAndState, PointerKey predPk, IFlowLabel label)
void
handleTrackedPointsToWorklist()
protected boolean
handleTrackedPred(com.ibm.wala.util.intset.MutableIntSet curTrackedSet, PointerKeyAndState predPkAndState, IFlowLabel label)
Handle a predecessor when processing some tracked locationsvoid
makePassOverFieldStmts()
protected java.util.Collection<PointerKeyAndState>
matchingPToQueried(PointerKeyAndState curPkAndState, PointerKey predPk, IFlowLabel label)
protected void
worklistLoop()
-
-
-
Field Detail
-
queriedPkAndState
protected final PointerKeyAndState queriedPkAndState
-
pkToP2Set
protected final java.util.Map<PointerKeyAndState,com.ibm.wala.util.intset.MutableIntSet> pkToP2Set
-
pkToTrackedSet
protected final java.util.Map<PointerKeyAndState,com.ibm.wala.util.intset.MutableIntSet> pkToTrackedSet
-
ikAndStates
protected final com.ibm.wala.util.intset.OrdinalSetMapping<InstanceKeyAndState> ikAndStates
for numberingInstanceKey
,StateMachine.State
pairs
-
-
Constructor Detail
-
PointsToComputer
protected PointsToComputer()
use this with care! only for subclasses that aren't computing points-to information exactly (e.g.,DemandRefinementPointsTo.FlowsToComputer
)
-
PointsToComputer
protected PointsToComputer(PointerKey pk)
-
PointsToComputer
protected PointsToComputer(PointerKeyAndState pkAndState)
-
-
Method Detail
-
getComputedP2Set
public java.util.Collection<InstanceKeyAndState> getComputedP2Set(PointerKeyAndState queried)
get a points-to set that has already been computed via some previous call tocompute()
; does _not_ do any fresh demand-driven computation.
-
addAllToP2Set
protected boolean addAllToP2Set(java.util.Map<PointerKeyAndState,com.ibm.wala.util.intset.MutableIntSet> p2setMap, PointerKeyAndState pkAndState, com.ibm.wala.util.intset.IntSet vals, IFlowLabel label)
-
compute
protected void compute()
-
worklistLoop
protected void worklistLoop()
-
matchingPToQueried
protected java.util.Collection<PointerKeyAndState> matchingPToQueried(PointerKeyAndState curPkAndState, PointerKey predPk, IFlowLabel label)
- Parameters:
label
- the label of the edge from curPk to predPk (must be barred)- Returns:
- those
PointerKeyAndState
s whose points-to sets have been queried, such that thePointerKey
is predPk, and transitioning from its state onlabel.bar()
yields the state ofcurPkAndState
-
handleBackCopy
protected void handleBackCopy(PointerKeyAndState curPkAndState, PointerKey predPk, IFlowLabel label)
-
addToTrackedPToWorklist
protected void addToTrackedPToWorklist(PointerKeyAndState pkAndState)
-
calleeSubGraphMissingAndShouldNotBeAdded
protected boolean calleeSubGraphMissingAndShouldNotBeAdded(boolean addGraphs, CGNode callee, PointerKeyAndState pkAndState)
when doing backward interprocedural propagation, is it true that we should not add a graph representation for a callee _and_ that the subgraph for the callee is missing?- Parameters:
addGraphs
- whether graphs should always be added
-
handleTrackedPointsToWorklist
public void handleTrackedPointsToWorklist()
-
makePassOverFieldStmts
public void makePassOverFieldStmts()
-
findOrCreate
protected <K> com.ibm.wala.util.intset.MutableIntSet findOrCreate(java.util.Map<K,com.ibm.wala.util.intset.MutableIntSet> M, K key)
-
find
protected <K> com.ibm.wala.util.intset.MutableIntSet find(java.util.Map<K,com.ibm.wala.util.intset.MutableIntSet> M, K key)
-
handleTrackedPred
protected boolean handleTrackedPred(com.ibm.wala.util.intset.MutableIntSet curTrackedSet, PointerKeyAndState predPkAndState, IFlowLabel label)
Handle a predecessor when processing some tracked locations- Parameters:
curTrackedSet
- the tracked locationspredPkAndState
- the predecessor
-
-