Data

dotty.tools.dotc.transform.init.Semantic.Cache.Data
class Data extends Cache[Value, Value]

Attributes

Graph
Supertypes
class Cache[Value, Value]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def backup(): Data

Backup the state of the cache

Backup the state of the cache

All the shared data structures must be immutable.

Attributes

override def get(value: Value, expr: Tree): Option[Value]

Attributes

Definition Classes
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

override def prepareForNextIteration()(using Context): Unit

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

Definition Classes
def restore(cache: Data): Unit

Restore state from a backup

Restore state from a backup

Attributes

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

Inherited methods

def cachedEval(config: Value, expr: Tree, cacheResult: Boolean, default: Value)(eval: Tree => Value): Value

Evaluate an expression with cache

Evaluate an expression with cache

The algorithmic skeleton is as follows:

if don't cache result then
  return eval(expr)
if this.current.contains(config, expr) then
  return cached value
else
  val assumed = this.last(config, expr) or bottom value if absent
  this.current(config, expr) = assumed
  val actual = eval(expr)

  if assumed != actual then
    this.changed = true
    this.current(config, expr) = actual

Attributes

Inherited from:
Cache

Attributes

Inherited from:
Cache

Attributes

Inherited from:
Cache