soot.jimple.spark
Class SparkOptions
java.lang.Object
|
+--soot.jimple.spark.SparkOptions
- public class SparkOptions
- extends java.lang.Object
Various options regulating the functioning of Spark.
Field Summary |
protected java.util.Map |
options
|
Method Summary |
boolean |
addTags()
When this option is set to true, the results of the analysis are encoded inside
tags, and printed with the resulting Jimple code. |
boolean |
classMethodVar()
When this option is set to true, the representation dumped by the dumpPAG option
represents nodes by numbering each class, method, and variable within
the method separately, rather than assigning a single integer to each
node. |
void |
doubleSetNew(SparkOptions.Switch_doubleSetNew sw)
Selects an implementation for the sets of new objects in the double
points-to set implementation. |
void |
doubleSetOld(SparkOptions.Switch_doubleSetOld sw)
Selects an implementation for the sets of old objects in the double
points-to set implementation. |
boolean |
dumpAnswer()
When this option is set to true, the computed reaching types for each variable are
dumped to a file, so that they can be compared with the results of
other analyses (such as the old VTA). |
boolean |
dumpHTML()
When this option is set to true, a browseable HTML representation of the
pointer assignment graph is output after the analysis completes. |
boolean |
dumpPAG()
When this option is set to true, a representation of the pointer assignment graph
suitable for processing with other solvers (such as the BDD-based solver) is
output before the analysis begins. |
boolean |
dumpSolution()
When this option is set to true, a representation of the resulting points-to
sets is dumped. |
boolean |
dumpTypes()
When this option is set to true, the representation dumped by the dumpPAG option
includes type information for all nodes. |
boolean |
forceGCs()
When this option is set to true, calls to System.gc() will be made at
various points to allow memory usage to be measured. |
static java.lang.String |
getDeclaredOptions()
|
static java.lang.String |
getDefaultOptions()
|
boolean |
ignoreBaseObjects()
When this option is set to true, fields are represented by variable
(Green) nodes, and the object that the field belongs to is ignored
(all objects are lumped together). |
boolean |
ignoreTypesEntirely()
When this option is set to true, all parts of Spark completely ignore
declared types of variables and casts. |
boolean |
ignoreTypesForSCCs()
When this option is set to true, when collapsing strongly-connected
components, nodes forming SCCs are collapsed regardless of their type. |
boolean |
mergeStringBuffer()
When this option is set to true, all allocation sites creating
{\tt java.lang.StringBuffer} objects are grouped together as a single
allocation site. |
boolean |
onFlyCallGraph()
When this option is set to true, the call graph is computed on-the-fly
as points-to information is computed. |
boolean |
parmsAsFields()
When this option is set to true, parameters to methods are represented
as fields (Red nodes) of the this object; otherwise, parameters are
represented as variable (Green) nodes. |
boolean |
preJimplify()
When this option is set to true, convert all available methods to Jimple
before starting the points-to analysis. |
void |
propagator(SparkOptions.Switch_propagator sw)
This option tells Spark which propagation algorithm to use. |
boolean |
returnsAsFields()
When this option is set to true, return values from methods are
represented as fields (Red nodes) of the this object; otherwise,
return values are represented as variable (Green) nodes. |
boolean |
RTA()
Setting RTA to true sets typesForSites to true, and causes Spark to use
a single points-to set for all variables, giving Rapid Type
Analysis~\cite{baco.swee96}. |
void |
setImpl(SparkOptions.Switch_setImpl sw)
Selects an implementation of a points-to set that Spark should use. |
boolean |
simpleEdgesBidirectional()
When this option is set to true, all edges connecting variable (Green)
nodes are made bidirectional, as in Steensgaard's analysis~\cite{stee96*1}. |
boolean |
simplifyOffline()
When this option is set to true, variable (Green) nodes which are
connected by simple paths (so they must have the same points-to set) are
merged together. |
boolean |
simplifySCCs()
When this option is set to true, variable (Green) nodes which form
strongly-connected components (so they must have the same points-to set)
are merged together. |
boolean |
simulateNatives()
When this option is set to true, effects of native methods are simulated. |
boolean |
topoSort()
When this option is set to true, the representation dumped by the dumpPAG option
is dumped with the green nodes in (pseudo-)topological order. |
boolean |
trimInvokeGraph()
When this option is set to true, the results of the analysis are used to make the invoke graph
more precise after the analysis completes. |
boolean |
typesForSites()
When this option is set to true, types rather than allocation sites are
used as the elements of the points-to sets. |
boolean |
verbose()
When this option is set to true, Spark prints detailed information. |
boolean |
VTA()
Setting VTA to true has the effect of setting ignoreBaseObjects,
typesForSites, and simplifySCCs to true to simulate Variable Type
Analysis, described in~\cite{sund.hend.ea00}. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
options
protected java.util.Map options
SparkOptions
public SparkOptions(java.util.Map options)
verbose
public boolean verbose()
- When this option is set to true, Spark prints detailed information.
Default value is false
ignoreTypesEntirely
public boolean ignoreTypesEntirely()
- When this option is set to true, all parts of Spark completely ignore
declared types of variables and casts.
Default value is false
forceGCs
public boolean forceGCs()
- When this option is set to true, calls to System.gc() will be made at
various points to allow memory usage to be measured.
Default value is false
preJimplify
public boolean preJimplify()
- When this option is set to true, convert all available methods to Jimple
before starting the points-to analysis. This allows the Jimplification
time to be separated from the points-to time. However, it increases the
total time and memory requirement, because all methods are Jimplified,
rather than only those deemed reachable by the points-to analysis.
Default value is false
VTA
public boolean VTA()
- Setting VTA to true has the effect of setting ignoreBaseObjects,
typesForSites, and simplifySCCs to true to simulate Variable Type
Analysis, described in~\cite{sund.hend.ea00}. Note that the
algorithm differs from the original VTA in that it handles array
elements more precisely. To use the results of the analysis to trim the
invoke graph, set the trimInvokeGraph option to true as well.
Default value is false
RTA
public boolean RTA()
- Setting RTA to true sets typesForSites to true, and causes Spark to use
a single points-to set for all variables, giving Rapid Type
Analysis~\cite{baco.swee96}.
To use the results of the analysis to trim the invoke graph, set the
trimInvokeGraph option to true as well.
Default value is false
ignoreBaseObjects
public boolean ignoreBaseObjects()
- When this option is set to true, fields are represented by variable
(Green) nodes, and the object that the field belongs to is ignored
(all objects are lumped together). Otherwise, fields are represented by
field reference (Red) nodes, and the objects that they belong to are
distinguished.
Default value is false
typesForSites
public boolean typesForSites()
- When this option is set to true, types rather than allocation sites are
used as the elements of the points-to sets.
Default value is false
mergeStringBuffer
public boolean mergeStringBuffer()
- When this option is set to true, all allocation sites creating
{\tt java.lang.StringBuffer} objects are grouped together as a single
allocation site.
Default value is true
simulateNatives
public boolean simulateNatives()
- When this option is set to true, effects of native methods are simulated.
Default value is true
simpleEdgesBidirectional
public boolean simpleEdgesBidirectional()
- When this option is set to true, all edges connecting variable (Green)
nodes are made bidirectional, as in Steensgaard's analysis~\cite{stee96*1}.
Default value is false
onFlyCallGraph
public boolean onFlyCallGraph()
- When this option is set to true, the call graph is computed on-the-fly
as points-to information is computed. Otherwise, an initial
approximation to the call graph is used.
Default value is false
parmsAsFields
public boolean parmsAsFields()
- When this option is set to true, parameters to methods are represented
as fields (Red nodes) of the this object; otherwise, parameters are
represented as variable (Green) nodes.
Default value is false
returnsAsFields
public boolean returnsAsFields()
- When this option is set to true, return values from methods are
represented as fields (Red nodes) of the this object; otherwise,
return values are represented as variable (Green) nodes.
Default value is false
simplifyOffline
public boolean simplifyOffline()
- When this option is set to true, variable (Green) nodes which are
connected by simple paths (so they must have the same points-to set) are
merged together.
Default value is false
simplifySCCs
public boolean simplifySCCs()
- When this option is set to true, variable (Green) nodes which form
strongly-connected components (so they must have the same points-to set)
are merged together.
Default value is false
ignoreTypesForSCCs
public boolean ignoreTypesForSCCs()
- When this option is set to true, when collapsing strongly-connected
components, nodes forming SCCs are collapsed regardless of their type.
The collapsed SCC is given the most general type of all the nodes in the
component.
When this option is set to false, only edges connecting nodes of the
same type are considered when detecting SCCs.
This option has no effect unless simplifySCCs is true.
Default value is false
propagator
public void propagator(SparkOptions.Switch_propagator sw)
- This option tells Spark which propagation algorithm to use.
Iter is a simple, iterative algorithm, which propagates everything until the
graph does not change.
Worklist is a worklist-based algorithm that tries
to do as little work as possible. This is currently the fastest algorithm.
Alias is an alias-edge based algorithm. This algorithm tends to take
the least memory for very large problems, because it does not represent
explicitly points-to sets of fields of heap objects.
Merge is an algorithm that merges all yellow nodes with their corresponding
red nodes. This algorithm is not yet finished.
None means that propagation is not done; the graph is only built and
simplified.
Default value is worklist
setImpl
public void setImpl(SparkOptions.Switch_setImpl sw)
- Selects an implementation of a points-to set that Spark should use.
Hash is an implementation based on Java's built-in hash-set.
Bit is an implementation using a bit vector.
Hybrid is an implementation that keeps an explicit list of up to
16 elements, and switches to using a bit-vector when the set gets
larger than this.
Array is an implementation that keeps the elements of the points-to set
in an array that is always maintained in sorted order. Set membership is
tested using binary search, and set union and intersection are computed
using an algorithm based on the merge step from merge sort.
Double is an implementation that itself uses a pair of sets for
each points-to set. The first set in the pair stores new pointed-to
objects that have not yet been propagated, while the second set stores
old pointed-to objects that have been propagated and need not be
reconsidered. This allows the propagation algorithms to be incremental,
often speeding them up significantly.
Default value is double
doubleSetOld
public void doubleSetOld(SparkOptions.Switch_doubleSetOld sw)
- Selects an implementation for the sets of old objects in the double
points-to set implementation.
This option has no effect unless setImpl is set to double.
Default value is hybrid
doubleSetNew
public void doubleSetNew(SparkOptions.Switch_doubleSetNew sw)
- Selects an implementation for the sets of new objects in the double
points-to set implementation.
This option has no effect unless setImpl is set to double.
Default value is hybrid
dumpHTML
public boolean dumpHTML()
- When this option is set to true, a browseable HTML representation of the
pointer assignment graph is output after the analysis completes. Note
that this representation is typically very large.
Default value is false
dumpPAG
public boolean dumpPAG()
- When this option is set to true, a representation of the pointer assignment graph
suitable for processing with other solvers (such as the BDD-based solver) is
output before the analysis begins.
Default value is false
dumpSolution
public boolean dumpSolution()
- When this option is set to true, a representation of the resulting points-to
sets is dumped. The format is similar to that of the dumpPAG
option, and is therefore suitable for comparison with the results of other
solvers.
Default value is false
topoSort
public boolean topoSort()
- When this option is set to true, the representation dumped by the dumpPAG option
is dumped with the green nodes in (pseudo-)topological order.
This option has no effect unless dumpPAG is true.
Default value is false
dumpTypes
public boolean dumpTypes()
- When this option is set to true, the representation dumped by the dumpPAG option
includes type information for all nodes.
This option has no effect unless dumpPAG is true.
Default value is true
classMethodVar
public boolean classMethodVar()
- When this option is set to true, the representation dumped by the dumpPAG option
represents nodes by numbering each class, method, and variable within
the method separately, rather than assigning a single integer to each
node.
This option has no effect unless dumpPAG is true.
Setting classMethodVar to true has the effect of setting topoSort to false.
Default value is true
dumpAnswer
public boolean dumpAnswer()
- When this option is set to true, the computed reaching types for each variable are
dumped to a file, so that they can be compared with the results of
other analyses (such as the old VTA).
Default value is false
trimInvokeGraph
public boolean trimInvokeGraph()
- When this option is set to true, the results of the analysis are used to make the invoke graph
more precise after the analysis completes.
Default value is false
addTags
public boolean addTags()
- When this option is set to true, the results of the analysis are encoded inside
tags, and printed with the resulting Jimple code.
Default value is false
getDeclaredOptions
public static java.lang.String getDeclaredOptions()
getDefaultOptions
public static java.lang.String getDefaultOptions()