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.


Nested Class Summary
static class SparkOptions.Switch_doubleSetNew
           
static class SparkOptions.Switch_doubleSetOld
           
static class SparkOptions.Switch_propagator
           
static class SparkOptions.Switch_setImpl
           
 
Field Summary
protected  java.util.Map options
           
 
Constructor Summary
SparkOptions(java.util.Map options)
           
 
Method Summary
 boolean classMethodVar()
          If 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()
          If 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()
          If set to true, a browseable HTML representation of the pointer assignment graph is output after the analysis completes.
 boolean dumpPAG()
          If 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()
          If set to true, a representation of the resulting points-to sets is dumped.
 boolean dumpTypes()
          If set to true, the representation dumped by the dumpPAG option includes type information for all nodes.
 boolean forceGCs()
          If set to true, calls to System.gc() will be done at various points to allow memory usage to be measured.
static java.lang.String getDeclaredOptions()
           
static java.lang.String getDefaultOptions()
           
 boolean ignoreBaseObjects()
          If set to true, fields are represented by variable (Green) nodes, and the object that the field belongs to is ignored (all fields are lumped together).
 boolean ignoreTypesEntirely()
          If set to true, all parts of Spark completely ignore declared types of variables and casts.
 boolean ignoreTypesForSCCs()
          If set to true, when collapsing strongly-connected components, nodes forming SCCs are collapsed regardless of their type.
 boolean mergeStringBuffer()
          If set to true, all allocation sites creating java.lang.StringBuffer objects are grouped together as a single allocation site.
 boolean onFlyCallGraph()
          If set to true, the call graph is computed on-the-fly as points-to information is computed.
 boolean parmsAsFields()
          If set to true, parameters to methods are represented as fields (Red nodes) of the 'this' object; otherwise, parameters are represented as variable (Green) nodes.
 void propagator(SparkOptions.Switch_propagator sw)
          Tells Spark which propagation algorithm to use.
 boolean returnsAsFields()
          If 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, and causes Spark to use a single points-to set for all variables, giving Rapid Type Analysis.
 void setImpl(SparkOptions.Switch_setImpl sw)
          Selects an implementation of a points-to set that Spark should use.
 boolean simpleEdgesBidirectional()
          If set to true, all edges connecting variable (Green) nodes are made bidirectional, as in Steensgaard's analysis.
 boolean simplifyOffline()
          If 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()
          If 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()
          If set to true, effects of native methods are simulated.
 boolean topoSort()
          If set to true, the representation dumped by the dumpPAG option is dumped with the green nodes in (pseudo-)topological order.
 boolean trimInvokeGraph()
          If set to true, the results of the analysis are used to make the invoke graph more precise after the analysis completes.
 boolean typesForSites()
          If set to true, types rather than allocation sites are used as the elements of the points-to sets.
 boolean verbose()
          If set to true, Spark prints detailed information.
 boolean VTA()
          Setting VTA to true has the effect of setting ignoreBaseObjects, typesForSites, and collapseSCCs to true to simulate Variable Type Analysis, described in Sundaresan et al., OOPSLA 2000.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options

protected java.util.Map options
Constructor Detail

SparkOptions

public SparkOptions(java.util.Map options)
Method Detail

verbose

public boolean verbose()
If set to true, Spark prints detailed information. Default value is false


ignoreTypesEntirely

public boolean ignoreTypesEntirely()
If set to true, all parts of Spark completely ignore declared types of variables and casts. Default value is false


forceGCs

public boolean forceGCs()
If set to true, calls to System.gc() will be done at various points to allow memory usage to be measured. Default value is false


VTA

public boolean VTA()
Setting VTA to true has the effect of setting ignoreBaseObjects, typesForSites, and collapseSCCs to true to simulate Variable Type Analysis, described in Sundaresan et al., OOPSLA 2000. 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, and causes Spark to use a single points-to set for all variables, giving Rapid Type Analysis. 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()
If set to true, fields are represented by variable (Green) nodes, and the object that the field belongs to is ignored (all fields 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()
If 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()
If set to true, all allocation sites creating java.lang.StringBuffer objects are grouped together as a single allocation site. Default value is true


simulateNatives

public boolean simulateNatives()
If set to true, effects of native methods are simulated. Default value is false


simpleEdgesBidirectional

public boolean simpleEdgesBidirectional()
If set to true, all edges connecting variable (Green) nodes are made bidirectional, as in Steensgaard's analysis. Default value is false


onFlyCallGraph

public boolean onFlyCallGraph()
If 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()
If 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()
If 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()
If 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()
If 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()
If 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. If no node has the most general type, then the SCC is given no type, and may point to objects of any type. If set to false, only edges connecting nodes of the same type are considered when detecting SCCs. This option has no effect unless collapseSCCs is true. Default value is false


propagator

public void propagator(SparkOptions.Switch_propagator sw)
Tells Spark which propagation algorithm to use. Iter is a dumb, iterative algorithm, that 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()
If 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()
If 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()
If 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()
If 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()
If 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()
If 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()
If 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()
If 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


getDeclaredOptions

public static java.lang.String getDeclaredOptions()

getDefaultOptions

public static java.lang.String getDefaultOptions()