Package sootup.spark
Class Spark
java.lang.Object
sootup.spark.Spark
Main access point to SPARK's functionality.
Exposes the call graph (CHA up-front, supplied by the client, or built on-the-fly when
SparkOptions#isOnFlyCallGraph() is set) and a PointsToAnalysis over the resulting PAG.
Lower-level components such as the solver are package-private; clients should not bypass this
facade.
Spark spark = Spark.builder()
.view(view)
.entryPoints(List.of(mainSig))
.sparkOptions(SparkOptions.builder().onFlyCallGraph(true).build())
.build();
PointsToAnalysis pta = spark.getPointsToAnalysis();
CallGraph cg = spark.getCallGraph();
To reuse a call graph the client already computed instead of having SPARK run CHA, pass it via
callGraph(...). This is ignored (with a warning logged) when onFlyCallGraph is
on, since OTF mode grows its own call graph incrementally from the entry points instead of
consuming one.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the call graph: the one passed to the builder, one built via class-hierarchy analysis at construction time, or one grown on-the-fly duringsolve()whenSparkOptions#isOnFlyCallGraph()is set.getPag()Returns the underlying pointer assignment graph — intended for inspection and debugging.Returns a points-to analysis over the solved PAG.voidsolve()Builds the pointer assignment graph and (in OTF mode) the call graph.
-
Method Details
-
solve
public void solve()Builds the pointer assignment graph and (in OTF mode) the call graph. Invoked automatically by the accessors; calling it explicitly is optional and idempotent. -
getCallGraph
Returns the call graph: the one passed to the builder, one built via class-hierarchy analysis at construction time, or one grown on-the-fly duringsolve()whenSparkOptions#isOnFlyCallGraph()is set. -
getPointsToAnalysis
Returns a points-to analysis over the solved PAG. The result is cached. -
getPag
Returns the underlying pointer assignment graph — intended for inspection and debugging. -
getSparkOptions
-