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(dest: Cls, narrow: 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:

Represents the three types of nodes in our call graph:

  • LocalDef: a method definition in local code, with a code hash
  • Call: a method call site, connecting to its resolved local destinations
  • ExternalClsCall(dest, narrow): a shared proxy node for external callback edges. dest determines which callback methods are possible (by walking dest's ancestors in externalClassLocalDests). narrow determines which local subtypes receive those callbacks (subtypes of narrow). When a precise bytecode type (receiver or arg) is a subtype of dest, it serves as narrow for more precise fan-out; otherwise dest == narrow (no narrowing).

Attributes

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

Value members

Concrete methods

def spanningInvalidationTree(prevTransitiveCallGraphHashes: Map[String, Int], prevMethodCodeHashesOpt: Option[Map[String, Int]], methodCodeHashes: SortedMap[String, Int], transitiveCallGraphHashes0: Array[(Node, Int)], indexToNodes: Array[Node], indexGraphEdges: Array[Array[Int]]): Obj

Computes the spanning invalidation tree showing which code changes caused which transitive hash changes.

Computes the spanning invalidation tree showing which code changes caused which transitive hash changes.

Value parameters

indexGraphEdges

Call graph edges (caller -> callees)

indexToNodes

Node index to node mapping

methodCodeHashes

Current method code hashes

prevMethodCodeHashesOpt

Previous method code hashes (to find actual code changes)

prevTransitiveCallGraphHashes

Previous transitive hashes (to detect what changed)

transitiveCallGraphHashes0

Current transitive hashes

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