N - The type of nodes in the interprocedural control-flow graph.
Typically Unit.D - The type of data-flow facts to be computed by the tabulation
problem.I - The type of inter-procedural control-flow graph being used.public class FlowInsensitiveSolver<N extends soot.Unit,D extends FastSolverLinkedNode<D,N>,I extends soot.jimple.toolkits.ide.icfg.BiDiInterproceduralCFG<soot.Unit,soot.SootMethod>> extends Object implements IMemoryBoundedSolver
IFDSTabulationProblem. This solver is not based on
the IDESolver implementation in Heros for performance reasons.IFDSTabulationProblemIMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification| 限定符和类型 | 字段和说明 |
|---|---|
static boolean |
DEBUG |
static com.google.common.cache.CacheBuilder<Object,Object> |
DEFAULT_CACHE_BUILDER |
protected MyConcurrentHashMap<heros.solver.Pair<soot.SootMethod,D>,Set<heros.solver.Pair<soot.Unit,D>>> |
endSummary |
protected InterruptableExecutor |
executor |
protected heros.FlowFunctionCache<soot.Unit,D,soot.SootMethod> |
ffCache |
protected heros.FlowFunctions<soot.Unit,D,soot.SootMethod> |
flowFunctions |
protected boolean |
followReturnsPastSeeds |
protected I |
icfg |
protected MyConcurrentHashMap<heros.solver.Pair<soot.SootMethod,D>,MyConcurrentHashMap<soot.Unit,Map<D,D>>> |
incoming |
protected Map<soot.Unit,Set<D>> |
initialSeeds |
protected MyConcurrentHashMap<heros.solver.PathEdge<soot.SootMethod,D>,D> |
jumpFunctions |
protected static org.slf4j.Logger |
logger |
protected IMemoryManager<D,N> |
memoryManager |
protected int |
numThreads |
long |
propagationCount |
protected PredecessorShorteningMode |
shorteningMode |
protected D |
zeroValue |
| 构造器和说明 |
|---|
FlowInsensitiveSolver(heros.IFDSTabulationProblem<soot.Unit,D,soot.SootMethod,I> tabulationProblem)
Creates a solver for the given problem, which caches flow functions and edge
functions.
|
FlowInsensitiveSolver(heros.IFDSTabulationProblem<soot.Unit,D,soot.SootMethod,I> tabulationProblem,
com.google.common.cache.CacheBuilder flowFunctionCacheBuilder)
Creates a solver for the given problem, constructing caches with the given
CacheBuilder. |
| 限定符和类型 | 方法和说明 |
|---|---|
D |
addFunction(heros.solver.PathEdge<soot.SootMethod,D> edge)
Records a jump function.
|
protected boolean |
addIncoming(soot.SootMethod m,
D d3,
soot.Unit n,
D d1,
D d2) |
void |
addStatusListener(IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification listener)
Adds a new listener that will be notified of status changes in the solver
|
protected void |
applyEndSummaryOnCall(D d1,
soot.Unit n,
D d2,
Collection<soot.Unit> returnSiteNs,
soot.SootMethod sCalledProcN,
D d3) |
protected void |
awaitCompletionComputeValuesAndShutdown()
Awaits the completion of the exploded super graph.
|
protected Set<D> |
computeCallFlowFunction(heros.FlowFunction<D> callFlowFunction,
D d1,
D d2)
Computes the call flow function for the given call-site abstraction
|
protected Set<D> |
computeCallToReturnFlowFunction(heros.FlowFunction<D> callToReturnFlowFunction,
D d1,
D d2)
Computes the call-to-return flow function for the given call-site abstraction
|
protected Set<D> |
computeNormalFlowFunction(heros.FlowFunction<D> flowFunction,
D d1,
D d2)
Computes the normal flow function for the given set of start and end
abstractions.
|
protected Set<D> |
computeReturnFlowFunction(heros.FlowFunction<D> retFunction,
D d1,
D d2,
soot.Unit callSite,
Collection<D> callerSideDs)
Computes the return flow function for the given set of caller-side
abstractions.
|
protected Set<heros.solver.Pair<soot.Unit,D>> |
endSummary(soot.SootMethod m,
D d3) |
void |
forceTerminate(ISolverTerminationReason reason)
Forces the solver to terminate its tasks and stop processing new tasks.
|
protected String |
getDebugName()
Returns a String used to identify the output of this solver in debug mode.
|
protected InterruptableExecutor |
getExecutor()
Factory method for this solver's thread-pool executor.
|
IMemoryManager<D,N> |
getMemoryManager()
Gets the memory manager used by this solver to reduce memory consumption
|
protected boolean |
getSolverId() |
ISolverTerminationReason |
getTerminationReason()
In case this solver was killed before it could complete its task, this
method returns the reason for the abortion.
|
protected Map<soot.Unit,Map<D,D>> |
incoming(D d1,
soot.SootMethod m) |
boolean |
isKilled()
Checks whether this solver was killed before it could complete its tasks
|
boolean |
isTerminated()
Checks whether this solver is terminated, either by forced termination,
or because it has finished all of its work.
|
void |
printStats() |
protected void |
processExit(D d1,
soot.Unit n,
D d2)
Lines 21-32 of the algorithm.
|
protected void |
propagate(D sourceVal,
soot.SootMethod target,
D targetVal,
soot.Unit relatedCallSite,
boolean isUnbalancedReturn)
Propagates the flow further down the exploded super graph.
|
protected void |
propagate(D sourceVal,
soot.SootMethod target,
D targetVal,
soot.Unit relatedCallSite,
boolean isUnbalancedReturn,
boolean schedule)
Propagates the flow further down the exploded super graph.
|
void |
reset()
Resets the solver to its initial state after it has been forcefully
terminated.
|
protected void |
scheduleEdgeProcessing(heros.solver.PathEdge<soot.SootMethod,D> edge)
Dispatch the processing of a given edge.
|
void |
setMaxAbstractionPathLength(int maxAbstractionPathLength) |
void |
setMaxCalleesPerCallSite(int maxCalleesPerCallSite) |
void |
setMaxJoinPointAbstractions(int maxJoinPointAbstractions)
Sets the maximum number of abstractions that shall be recorded per join
point.
|
void |
setMemoryManager(IMemoryManager<D,N> memoryManager)
Sets the memory manager that shall be used to manage the abstractions
|
void |
setPredecessorShorteningMode(PredecessorShorteningMode mode)
Sets whether abstractions on method returns shall be connected to the
respective call abstractions to shortcut paths.
|
protected void |
setSolverId(boolean solverId) |
void |
solve()
Runs the solver on the configured problem.
|
protected void |
submitInitialSeeds()
Schedules the processing of initial seeds, initiating the analysis.
|
public static com.google.common.cache.CacheBuilder<Object,Object> DEFAULT_CACHE_BUILDER
protected static final org.slf4j.Logger logger
public static final boolean DEBUG
protected InterruptableExecutor executor
protected int numThreads
protected MyConcurrentHashMap<heros.solver.PathEdge<soot.SootMethod,D extends FastSolverLinkedNode<D,N>>,D extends FastSolverLinkedNode<D,N>> jumpFunctions
protected final I extends soot.jimple.toolkits.ide.icfg.BiDiInterproceduralCFG<soot.Unit,soot.SootMethod> icfg
protected final MyConcurrentHashMap<heros.solver.Pair<soot.SootMethod,D extends FastSolverLinkedNode<D,N>>,Set<heros.solver.Pair<soot.Unit,D extends FastSolverLinkedNode<D,N>>>> endSummary
protected final MyConcurrentHashMap<heros.solver.Pair<soot.SootMethod,D extends FastSolverLinkedNode<D,N>>,MyConcurrentHashMap<soot.Unit,Map<D extends FastSolverLinkedNode<D,N>,D extends FastSolverLinkedNode<D,N>>>> incoming
protected final heros.FlowFunctions<soot.Unit,D extends FastSolverLinkedNode<D,N>,soot.SootMethod> flowFunctions
public long propagationCount
protected final D extends FastSolverLinkedNode<D,N> zeroValue
protected final heros.FlowFunctionCache<soot.Unit,D extends FastSolverLinkedNode<D,N>,soot.SootMethod> ffCache
protected final boolean followReturnsPastSeeds
protected PredecessorShorteningMode shorteningMode
protected IMemoryManager<D extends FastSolverLinkedNode<D,N>,N extends soot.Unit> memoryManager
public FlowInsensitiveSolver(heros.IFDSTabulationProblem<soot.Unit,D,soot.SootMethod,I> tabulationProblem)
solve().public FlowInsensitiveSolver(heros.IFDSTabulationProblem<soot.Unit,D,soot.SootMethod,I> tabulationProblem, com.google.common.cache.CacheBuilder flowFunctionCacheBuilder)
CacheBuilder. The solver must then be started by calling
solve().tabulationProblem - The tabulation problem to solveflowFunctionCacheBuilder - A valid CacheBuilder or
null if no caching is to be used
for flow functions.public void solve()
protected void submitInitialSeeds()
solve() should be called instead.protected void awaitCompletionComputeValuesAndShutdown()
protected boolean getSolverId()
protected void setSolverId(boolean solverId)
protected void scheduleEdgeProcessing(heros.solver.PathEdge<soot.SootMethod,D> edge)
edge - the edge to processprotected void applyEndSummaryOnCall(D d1, soot.Unit n, D d2, Collection<soot.Unit> returnSiteNs, soot.SootMethod sCalledProcN, D d3)
protected Set<D> computeCallFlowFunction(heros.FlowFunction<D> callFlowFunction, D d1, D d2)
callFlowFunction - The call flow function to computed1 - The abstraction at the current method's start node.d2 - The abstraction at the call siteprotected Set<D> computeCallToReturnFlowFunction(heros.FlowFunction<D> callToReturnFlowFunction, D d1, D d2)
callToReturnFlowFunction - The call-to-return flow function to computed1 - The abstraction at the current method's start
node.d2 - The abstraction at the call siteprotected void processExit(D d1, soot.Unit n, D d2)
edge - an edge whose target node resembles a method exitsprotected Set<D> computeReturnFlowFunction(heros.FlowFunction<D> retFunction, D d1, D d2, soot.Unit callSite, Collection<D> callerSideDs)
retFunction - The return flow function to computed1 - The abstraction at the beginning of the calleed2 - The abstraction at the exit node in the calleecallSite - The call sitecallerSideDs - The abstractions at the call siteprotected Set<D> computeNormalFlowFunction(heros.FlowFunction<D> flowFunction, D d1, D d2)
flowFunction - The normal flow function to computed1 - The abstraction at the method's start noded2 - The abstraction at the current nodeprotected void propagate(D sourceVal, soot.SootMethod target, D targetVal, soot.Unit relatedCallSite, boolean isUnbalancedReturn)
sourceVal - the source value of the propagated summary edgetarget - the target statementtargetVal - the target value at the target statementrelatedCallSite - for call and return flows the related call
statement, null otherwise (this value
is not used within this implementation but may be
useful for subclasses of
FlowInsensitiveSolver)isUnbalancedReturn - true if this edge is propagating an
unbalanced return (this value is not used within
this implementation but may be useful for
subclasses of FlowInsensitiveSolver)protected void propagate(D sourceVal, soot.SootMethod target, D targetVal, soot.Unit relatedCallSite, boolean isUnbalancedReturn, boolean schedule)
sourceVal - the source value of the propagated summary edgetarget - the target statementtargetVal - the target value at the target statementrelatedCallSite - for call and return flows the related call
statement, null otherwise (this value
is not used within this implementation but may be
useful for subclasses of
FlowInsensitiveSolver)isUnbalancedReturn - true if this edge is propagating an
unbalanced return (this value is not used within
this implementation but may be useful for
subclasses of FlowInsensitiveSolver)forceRegister - True if the jump function must always be registered
with jumpFn . This can happen when externally
injecting edges that don't come out of this solver.public D addFunction(heros.solver.PathEdge<soot.SootMethod,D> edge)
PathEdgeprotected InterruptableExecutor getExecutor()
protected String getDebugName()
public void printStats()
public void setPredecessorShorteningMode(PredecessorShorteningMode mode)
mode - The strategy to use for shortening predecessor pathspublic void setMaxJoinPointAbstractions(int maxJoinPointAbstractions)
maxJoinPointAbstractions - The maximum number of abstractions per join
point, or -1 to record an arbitrary number of
join point abstractionspublic void setMemoryManager(IMemoryManager<D,N> memoryManager)
memoryManager - The memory manager that shall be used to manage the
abstractionspublic IMemoryManager<D,N> getMemoryManager()
public void forceTerminate(ISolverTerminationReason reason)
IMemoryBoundedSolverforceTerminate 在接口中 IMemoryBoundedSolverreason - The reason why the solver is terminatedpublic boolean isTerminated()
IMemoryBoundedSolverisTerminated 在接口中 IMemoryBoundedSolverpublic boolean isKilled()
IMemoryBoundedSolverisKilled 在接口中 IMemoryBoundedSolverpublic void reset()
IMemoryBoundedSolverreset 在接口中 IMemoryBoundedSolverpublic void addStatusListener(IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification listener)
IMemoryBoundedSolveraddStatusListener 在接口中 IMemoryBoundedSolverlistener - The listener that will be notified when the status of the
solver changespublic ISolverTerminationReason getTerminationReason()
IMemoryBoundedSolvergetTerminationReason 在接口中 IMemoryBoundedSolverpublic void setMaxCalleesPerCallSite(int maxCalleesPerCallSite)
public void setMaxAbstractionPathLength(int maxAbstractionPathLength)
Copyright © 2022 Fraunhofer SIT. All rights reserved.