Cache

dotty.tools.dotc.transform.init.Semantic$.Cache$.Cache
class Cache

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def assume(value: Value, expr: Tree, cacheResult: Boolean)(fun: => Value): () ?=> Value

Copy the value of (value, expr) from the last cache to the current cache

Copy the value of (value, expr) from the last cache to the current cache

It assumes the value is Hot if it doesn't exist in the last cache.

It updates the current caches if the values change.

The two caches are required because we want to make sure in a new iteration, an expression is evaluated once.

Attributes

def backup(): Cache

Backup the state of the cache

Backup the state of the cache

All the shared data structures must be immutable.

Attributes

def get(value: Value, expr: Tree): Option[Value]
def getObject(ref: Ref): Objekt

Prepare for checking next class

Prepare for checking next class

  1. Reset changed flag.

  2. Commit current cache to stable cache if not changed.

  3. Update stable heap if not changed.

  4. Reset last cache.

Attributes

Prepare cache for the next iteration

Prepare cache for the next iteration

  1. Reset changed flag.

  2. Use current cache as last cache and set current cache to be empty.

  3. Revert heap to stable.

Attributes

def restore(cache: Cache): Unit

Restore state from a backup

Restore state from a backup

Attributes

def updateObject(ref: Ref, obj: Objekt): Unit