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
Modifier and TypeClassDescriptionprotected class
used to compute "flows-to sets," i.e., all the pointers that can point to some instance keyprotected class
Points-to analysis algorithm code.static enum
Possible results of a query. -
Field Summary
Modifier and TypeFieldDescriptionprotected final IFlowGraph
long
to measure memory usageprotected RefinementPolicy
Fields inherited from class com.ibm.wala.demandpa.alg.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 DemandRefinementPointsTo
makeWithDefaultFlowGraph
(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 setvoid
setRefinementPolicyFactory
(RefinementPolicyFactory refinementPolicyFactory) void
setStateMachineFactory
(StateMachineFactory<IFlowLabel> stateMachineFactory) protected void
re-initialize state for a new queryMethods inherited from class com.ibm.wala.demandpa.alg.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.PointsToResult
indicating whether a points-to set satisfying the predicate was computed, and (2) the last computed points-to set for the variable (possiblynull
if no points-to set could be computed in the budget) - Throws:
IllegalArgumentException
- ifpk
is 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.PointsToResult
indicating whether a points-to set satisfying the predicate was computed - Throws:
IllegalArgumentException
- ifpk
is not aLocalPointerKey
; to eventually be fixed
-
getPointsTo
- Returns:
- the points-to set of
pk
, ornull
if the points-to set can't be computed in the allocated budget
-
getPointsToWithStates
- Returns:
- the points-to set of
pk
, including theStateMachine.State
s attached to theInstanceKey
s, ornull
if 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.PointsToResult
indicating whether a flows-to set was computed, and (2) the last computed flows-to set for the instance key (possiblynull
if 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.PointsToResult
indicating whether a flows-to set was computed, and (2) the last computed flows-to set for the instance key (possiblynull
if no flows-to set could be computed in the budget)
-
getStateMachineFactory
-
setStateMachineFactory
-
getRefinementPolicyFactory
-
setRefinementPolicyFactory
-