Class DemandRefinementPointsTo.PointsToComputer
java.lang.Object
com.ibm.wala.demandpa.alg.DemandRefinementPointsTo.PointsToComputer
- Direct Known Subclasses:
DemandRefinementPointsTo.FlowsToComputer
- Enclosing class:
DemandRefinementPointsTo
Points-to analysis algorithm code.
Pseudocode in Chapter 5 of Manu Sridharan's dissertation.
- Author:
- Manu Sridharan
-
Field Summary
Modifier and TypeFieldDescriptionprotected final OrdinalSetMapping
<InstanceKeyAndState> for numberingInstanceKey
,StateMachine.State
pairsprotected final Map
<PointerKeyAndState, MutableIntSet> protected final Map
<PointerKeyAndState, MutableIntSet> protected final PointerKeyAndState
-
Constructor Summary
ModifierConstructorDescriptionprotected
use this with care! only for subclasses that aren't computing points-to information exactly (e.g.,DemandRefinementPointsTo.FlowsToComputer
)protected
PointsToComputer
(PointerKeyAndState pkAndState) protected
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
addAllToP2Set
(Map<PointerKeyAndState, MutableIntSet> p2setMap, PointerKeyAndState pkAndState, 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> MutableIntSet
find
(Map<K, MutableIntSet> M, K key) protected <K> MutableIntSet
findOrCreate
(Map<K, MutableIntSet> M, K key) 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
protected boolean
handleTrackedPred
(MutableIntSet curTrackedSet, PointerKeyAndState predPkAndState, IFlowLabel label) Handle a predecessor when processing some tracked locationsvoid
protected Collection
<PointerKeyAndState> matchingPToQueried
(PointerKeyAndState curPkAndState, PointerKey predPk, IFlowLabel label) protected void
-
Field Details
-
queriedPkAndState
-
pkToP2Set
-
pkToTrackedSet
-
ikAndStates
for numberingInstanceKey
,StateMachine.State
pairs
-
-
Constructor Details
-
PointsToComputer
protected PointsToComputer()use this with care! only for subclasses that aren't computing points-to information exactly (e.g.,DemandRefinementPointsTo.FlowsToComputer
) -
PointsToComputer
-
PointsToComputer
-
-
Method Details
-
getComputedP2Set
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(Map<PointerKeyAndState, MutableIntSet> p2setMap, PointerKeyAndState pkAndState, IntSet vals, IFlowLabel label) -
compute
protected void compute() -
worklistLoop
protected void worklistLoop() -
matchingPToQueried
protected 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
-
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
-
find
-
handleTrackedPred
protected boolean handleTrackedPred(MutableIntSet curTrackedSet, PointerKeyAndState predPkAndState, IFlowLabel label) Handle a predecessor when processing some tracked locations- Parameters:
curTrackedSet
- the tracked locationspredPkAndState
- the predecessor
-