class
CallGraphCache[Contour, Value] extends AnyRef
Instance Constructors
-
new
CallGraphCache(project: SomeProject)
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
def
+(other: String): String
-
def
->[B](y: B): (CallGraphCache[Contour, Value], B)
-
final
def
==(arg0: Any): Boolean
-
val
NullPointerExceptionDefaultConstructor: Option[Method]
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
ensuring(cond: (CallGraphCache[Contour, Value]) ⇒ Boolean, msg: ⇒ Any): CallGraphCache[Contour, Value]
-
def
ensuring(cond: (CallGraphCache[Contour, Value]) ⇒ Boolean): CallGraphCache[Contour, Value]
-
def
ensuring(cond: Boolean, msg: ⇒ Any): CallGraphCache[Contour, Value]
-
def
ensuring(cond: Boolean): CallGraphCache[Contour, Value]
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
def
formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
-
def
getOrElseUpdate(key: ObjectType, contour: Contour)(f: ⇒ Value, syncOnEvaluation: Boolean = true): Value
-
def
getOrElseUpdate(key: ObjectType)(f: ⇒ Value): Value
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
def
→[B](y: B): (CallGraphCache[Contour, Value], B)
Inherited from AnyRef
Inherited from Any
A thread-safe cache for information that is associated with a specific
ObjectType
and an additional key (Contour
). Conceptually, the cache is aMap
ofMap
s where the keys of the first map areObjectType
s and which return values that are maps where the keys areContour
s and the values are the stored/cached information.To minimize contention the cache's maps are all preinitialized based on the number of different types that we have seen. This ensure that two threads can always concurrently access the cache (without blocking) if the information is associated with two different
ObjectType
s. If two threads want to access information that is associated with the sameObjectType
the data-structures try to minimize potential contention. Hence, this is not a general purpose cache. Using this cache is only appropriate if you need/will cache a lot of information that is associated with different object types.It is required that the cache object is created before the threads are created that use the cache!
Example Usage
To store the result of the computation of all target methods for a virtual method call (given some declaring class type and a method signature), the cache could be instantiated as follows:
Creating a new cache is comparatively expensive and depends on the number of
ObjectType
s in a project.