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
FieldsModifier and TypeFieldDescriptionprotected final OrdinalSetMapping<InstanceKeyAndState> for numberingInstanceKey,StateMachine.Statepairsprotected final Map<PointerKeyAndState, MutableIntSet> protected final Map<PointerKeyAndState, MutableIntSet> protected final PointerKeyAndState -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotecteduse this with care! only for subclasses that aren't computing points-to information exactly (e.g.,DemandRefinementPointsTo.FlowsToComputer)protectedPointsToComputer(PointerKeyAndState pkAndState) protected -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddAllToP2Set(Map<PointerKeyAndState, MutableIntSet> p2setMap, PointerKeyAndState pkAndState, IntSet vals, IFlowLabel label) protected voidaddToTrackedPToWorklist(PointerKeyAndState pkAndState) protected booleancalleeSubGraphMissingAndShouldNotBeAdded(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 voidcompute()protected <K> MutableIntSetfind(Map<K, MutableIntSet> M, K key) protected <K> MutableIntSetfindOrCreate(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 voidhandleBackCopy(PointerKeyAndState curPkAndState, PointerKey predPk, IFlowLabel label) voidprotected booleanhandleTrackedPred(MutableIntSet curTrackedSet, PointerKeyAndState predPkAndState, IFlowLabel label) Handle a predecessor when processing some tracked locationsvoidprotected Collection<PointerKeyAndState> matchingPToQueried(PointerKeyAndState curPkAndState, PointerKey predPk, IFlowLabel label) protected void
-
Field Details
-
queriedPkAndState
-
pkToP2Set
-
pkToTrackedSet
-
ikAndStates
for numberingInstanceKey,StateMachine.Statepairs
-
-
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
PointerKeyAndStates whose points-to sets have been queried, such that thePointerKeyis 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
-