CallGraphAnalysis

mill.codesig.CallGraphAnalysis
See theCallGraphAnalysis companion class

Attributes

Companion
class
Source
ReachabilityAnalysis.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class Call(call: MethodCall) extends Node

Attributes

Source
ReachabilityAnalysis.scala
Supertypes
trait Serializable
trait Serializable
trait Product
trait Equals
trait Node
class Object
trait Matchable
class Any
Show all
case class ExternalClsCall(call: Cls) extends Node

Attributes

Source
ReachabilityAnalysis.scala
Supertypes
trait Serializable
trait Serializable
trait Product
trait Equals
trait Node
class Object
trait Matchable
class Any
Show all
case class LocalDef(call: MethodDef) extends Node

Attributes

Source
ReachabilityAnalysis.scala
Supertypes
trait Serializable
trait Serializable
trait Product
trait Equals
trait Node
class Object
trait Matchable
class Any
Show all
sealed trait Node

Represents the three types of nodes in our call graph. These are kept heterogeneous because flattening them out into a homogenous graph of MethodDef -> MethodDef edges results in a lot of duplication that bloats the size of the graph non-linearly with the size of the program

Represents the three types of nodes in our call graph. These are kept heterogeneous because flattening them out into a homogenous graph of MethodDef -> MethodDef edges results in a lot of duplication that bloats the size of the graph non-linearly with the size of the program

Attributes

Source
ReachabilityAnalysis.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Call
class LocalDef

Value members

Concrete methods

def indexGraphEdges(indexToNodes: Array[Node], methods: Map[MethodDef, MethodInfo], resolved: ResolvedCalls, externalSummary: ExternalSummary, nodeToIndex: Map[Node, Int], ignoreCall: (Option[MethodDef], MethodSig) => Boolean)(using st: SymbolTable): Array[Array[Int]]

Attributes

Source
ReachabilityAnalysis.scala
def spanningInvalidationTree(prevTransitiveCallGraphHashes: Map[String, Int], transitiveCallGraphHashes0: Array[(Node, Int)], indexToNodes: Array[Node], indexGraphEdges: Array[Array[Int]]): Obj

Computes the minimal spanning forest of the that covers the nodes in the call graph whose transitive call graph hashes has changed since the last run, rendered as a JSON dictionary tree. This provides a great "debug view" that lets you easily Cmd-F to find a particular node and then trace it up the JSON hierarchy to figure out what upstream node was the root cause of the change in the callgraph.

Computes the minimal spanning forest of the that covers the nodes in the call graph whose transitive call graph hashes has changed since the last run, rendered as a JSON dictionary tree. This provides a great "debug view" that lets you easily Cmd-F to find a particular node and then trace it up the JSON hierarchy to figure out what upstream node was the root cause of the change in the callgraph.

There are typically multiple possible spanning forests for a given graph; one is chosen arbitrarily. This is usually fine, since when debugging you typically are investigating why there's a path to a node at all where none should exist, rather than trying to fully analyse all possible paths

Attributes

Source
ReachabilityAnalysis.scala
def transitiveCallGraphValues[V : ClassTag](indexGraphEdges: Array[Array[Int]], indexToNodes: Array[Node], nodeValues: Array[V], reduce: (V, V) => V, zero: V): Array[(Node, V)]

Summarizes the transitive closure of the given graph, using the given computeOutputValue and reduce functions to return a single value of T.

Summarizes the transitive closure of the given graph, using the given computeOutputValue and reduce functions to return a single value of T.

This is done in topological order, in order to allow us to memo-ize the values computed for upstream groups when processing downstream methods, avoiding the need to repeatedly re-compute them. Each Strongly Connected Component is processed together and assigned the same final value, since they all have the exact same transitive closure

Attributes

Source
ReachabilityAnalysis.scala

Implicits

Implicits

implicit def nodeRw: Writer[Node]

Attributes

Source
ReachabilityAnalysis.scala