Class DemandRefinementPointsTo
java.lang.Object
com.ibm.wala.demandpa.alg.AbstractDemandPointsTo
com.ibm.wala.demandpa.alg.DemandRefinementPointsTo
- All Implemented Interfaces:
IDemandPointerAnalysis
Demand-driven refinement-based points-to analysis.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classused to compute "flows-to sets," i.e., all the pointers that can point to some instance keyprotected classPoints-to analysis algorithm code.static enumPossible results of a query. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IFlowGraphlongto measure memory usageprotected RefinementPolicyFields inherited from class AbstractDemandPointsTo
cg, cha, heapModel, mam, numNodesTraversed, options -
Method Summary
Modifier and TypeMethodDescriptiongetFlowsTo(InstanceKeyAndState ikAndState) get all the pointer keys that some instance key with state can flow toget all the pointer keys that some instance key can flow togetPointsTo(PointerKey pk, Predicate<InstanceKey> ikeyPred) compute a points-to set for a pointer key, aiming to satisfy some predicatestatic DemandRefinementPointsTomakeWithDefaultFlowGraph(CallGraph cg, HeapModel model, MemoryAccessMap mam, IClassHierarchy cha, AnalysisOptions options, StateMachineFactory<IFlowLabel> stateMachineFactory) create a demand points-to analysis runnerpointsToPassesPred(PointerKey pk, Predicate<InstanceKey> ikeyPred, PointerAnalysis<InstanceKey> pa) check if the points-to set of a variable passes some predicate, without necessarily computing the whole points-to setvoidsetRefinementPolicyFactory(RefinementPolicyFactory refinementPolicyFactory) voidsetStateMachineFactory(StateMachineFactory<IFlowLabel> stateMachineFactory) protected voidre-initialize state for a new queryMethods inherited from class AbstractDemandPointsTo
getBaseCallGraph, getClassHierarchy, getHeapModel, getNumNodesTraversed, getTraversalBudget, incrementNumNodesTraversed, setNumNodesTraversed, setTraversalBudget
-
Field Details
-
g
-
refinementPolicy
-
lastQueryMemoryUse
public long lastQueryMemoryUseto measure memory usage
-
-
Method Details
-
getRefinementPolicy
-
startNewQuery
protected void startNewQuery()re-initialize state for a new query -
getPointsTo
public Pair<DemandRefinementPointsTo.PointsToResult, Collection<InstanceKey>> getPointsTo(PointerKey pk, Predicate<InstanceKey> ikeyPred) throws IllegalArgumentException compute a points-to set for a pointer key, aiming to satisfy some predicate- Parameters:
pk- the pointer keyikeyPred- the desired predicate that each instance key in the points-to set should ideally satisfy- Returns:
- a pair consisting of (1) a
DemandRefinementPointsTo.PointsToResultindicating whether a points-to set satisfying the predicate was computed, and (2) the last computed points-to set for the variable (possiblynullif no points-to set could be computed in the budget) - Throws:
IllegalArgumentException- ifpkis not aLocalPointerKey; to eventually be fixed
-
makeWithDefaultFlowGraph
public static DemandRefinementPointsTo makeWithDefaultFlowGraph(CallGraph cg, HeapModel model, MemoryAccessMap mam, IClassHierarchy cha, AnalysisOptions options, StateMachineFactory<IFlowLabel> stateMachineFactory) create a demand points-to analysis runner- Parameters:
cg- the underlying call graph for the analysismodel- the heap model to be used for the analysismam- indicates what code reads or writes each fieldstateMachineFactory- factory for state machines to track additional properties like calling context
-
pointsToPassesPred
public DemandRefinementPointsTo.PointsToResult pointsToPassesPred(PointerKey pk, Predicate<InstanceKey> ikeyPred, PointerAnalysis<InstanceKey> pa) throws IllegalArgumentException check if the points-to set of a variable passes some predicate, without necessarily computing the whole points-to set- Parameters:
pk- the pointer keyikeyPred- the desired predicate that each instance key in the points-to set should ideally satisfypa- a pre-computed points-to analysis- Returns:
- a
DemandRefinementPointsTo.PointsToResultindicating whether a points-to set satisfying the predicate was computed - Throws:
IllegalArgumentException- ifpkis not aLocalPointerKey; to eventually be fixed
-
getPointsTo
- Returns:
- the points-to set of
pk, ornullif the points-to set can't be computed in the allocated budget
-
getPointsToWithStates
- Returns:
- the points-to set of
pk, including theStateMachine.States attached to theInstanceKeys, ornullif the points-to set can't be computed in the allocated budget
-
getFlowsTo
public Pair<DemandRefinementPointsTo.PointsToResult, Collection<PointerKey>> getFlowsTo(InstanceKey ik) get all the pointer keys that some instance key can flow to- Returns:
- a pair consisting of (1) a
DemandRefinementPointsTo.PointsToResultindicating whether a flows-to set was computed, and (2) the last computed flows-to set for the instance key (possiblynullif no flows-to set could be computed in the budget)
-
getFlowsTo
public Pair<DemandRefinementPointsTo.PointsToResult, Collection<PointerKey>> getFlowsTo(InstanceKeyAndState ikAndState) get all the pointer keys that some instance key with state can flow to- Returns:
- a pair consisting of (1) a
DemandRefinementPointsTo.PointsToResultindicating whether a flows-to set was computed, and (2) the last computed flows-to set for the instance key (possiblynullif no flows-to set could be computed in the budget)
-
getStateMachineFactory
-
setStateMachineFactory
-
getRefinementPolicyFactory
-
setRefinementPolicyFactory
-