Packages

  • package root

    The Scala compiler and reflection APIs.

    The Scala compiler and reflection APIs.

    Definition Classes
    root
  • package scala
    Definition Classes
    root
  • package tools
    Definition Classes
    scala
  • package nsc
    Definition Classes
    tools
  • package backend
    Definition Classes
    nsc
  • package jvm
    Definition Classes
    backend
  • abstract class GenBCode extends SubComponent

    Some notes about the backend's state and its initialization and release.

    Some notes about the backend's state and its initialization and release.

    State that is used in a single run is allocated through recordPerRunCache, for example ByteCodeRepository.compilingClasses or CallGraph.callsites. This state is cleared at the end of each run.

    Some state needs to be re-initialized per run, for example CoreBTypes (computed from Symbols / Types) or the GeneratedClassHandler (depends on the compiler settings). This state is (re-) initialized in the GenBCode.initialize method. There two categories:

    1. State that is stored in a var field and (re-) assigned in the initialize method, for example the GeneratedClassHandler 2. State that uses the PerRunInit / bTypes.perRunLazy / LazyVar infrastructure, for example the types in CoreBTypes

    The reason to use the LazyVar infrastructure is to prevent eagerly computing all the state even if it's never used in a run. It can also be used to work around initialization ordering issues, just like ordinary lazy vals. For state that is known to be accessed, a var field is just fine.

    Typical LazyVar use: lazy val state: LazyVar[T] = perRunLazy(component)(initializer)

    • The initializer expression is executed lazily
    • When the initializer actually runs, it synchronizes on the PostProcessorFrontendAccess.frontendLock
    • The component.initialize method causes the LazyVar to be re-initialized on the next get
    • The state is itself a lazy val to make sure the component.initialize method only clears those LazyVars that were ever accessed

    TODO: convert some uses of LazyVar to ordinary var.

    Definition Classes
    jvm
  • BCodePhase
  • StdPhase

class BCodePhase extends StdPhase

Source
GenBCode.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BCodePhase
  2. StdPhase
  3. GlobalPhase
  4. Phase
  5. Ordered
  6. Comparable
  7. AnyRef
  8. Any
Implicitly
  1. by orderingToOrdered
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new BCodePhase(prev: Phase)

Type Members

  1. type Id = Int
    Definition Classes
    Phase

Value Members

  1. def <(that: reflect.internal.Phase): Boolean
    Definition Classes
    Ordered
  2. def <=(that: reflect.internal.Phase): Boolean
    Definition Classes
    Ordered
  3. def >(that: reflect.internal.Phase): Boolean
    Definition Classes
    Ordered
  4. def >=(that: reflect.internal.Phase): Boolean
    Definition Classes
    Ordered
  5. def apply(unit: Global.CompilationUnit): Unit
    Definition Classes
    BCodePhaseGlobalPhase
  6. final def applyPhase(unit: Global.CompilationUnit): Unit
    Definition Classes
    GlobalPhase
  7. final val assignsFields: Boolean
    Definition Classes
    Phase
  8. def cancelled(unit: Global.CompilationUnit): Boolean

    Is current phase cancelled on this unit?

    Is current phase cancelled on this unit?

    Definition Classes
    GlobalPhase
  9. def checkable: Boolean
    Definition Classes
    Phase
  10. def compare(that: reflect.internal.Phase): Id
    Definition Classes
    Phase → Ordered
  11. def compareTo(that: reflect.internal.Phase): Int
    Definition Classes
    Ordered → Comparable
  12. def description: String
    Definition Classes
    BCodePhase → Phase
  13. def equals(other: Any): Boolean
    Definition Classes
    Phase → AnyRef → Any
  14. final val erasedTypes: Boolean
    Definition Classes
    Phase
  15. def flagMask: Long
    Definition Classes
    Phase
  16. final val flatClasses: Boolean
    Definition Classes
    Phase
  17. val fmask: Long
    Definition Classes
    Phase
  18. def hasNext: Boolean
    Definition Classes
    Phase
  19. def hashCode(): Int
    Definition Classes
    Phase → AnyRef → Any
  20. val id: Id
    Definition Classes
    Phase
  21. def iterator: collection.Iterator[reflect.internal.Phase]
    Definition Classes
    Phase
  22. def keepsTypeParams: Boolean
    Definition Classes
    Phase
  23. def name: String
    Definition Classes
    StdPhase → Phase
  24. def newFlags: Long
    Definition Classes
    StdPhase → Phase
  25. def next: reflect.internal.Phase
    Definition Classes
    Phase
  26. def nextFlags: Long
    Definition Classes
    StdPhase → Phase
  27. val prev: reflect.internal.Phase
    Definition Classes
    Phase
  28. final val refChecked: Boolean
    Definition Classes
    Phase
  29. def run(): Unit
    Definition Classes
    BCodePhaseGlobalPhase → Phase
  30. final val specialized: Boolean
    Definition Classes
    Phase
  31. def toString(): String
    Definition Classes
    Phase → AnyRef → Any
  32. def writeOtherFiles(): Unit

Shadowed Implicit Value Members

  1. def <(that: BCodePhase): Boolean
    Implicit
    This member is added by an implicit conversion from BCodePhase tomath.Ordered[BCodePhase] performed by method orderingToOrdered in scala.math.Ordered.This conversion will take place only if an implicit value of type math.Ordering[BCodePhase] is in scope.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (bCodePhase: math.Ordered[BCodePhase]).<(that)
    Definition Classes
    Ordered
  2. def <=(that: BCodePhase): Boolean
    Implicit
    This member is added by an implicit conversion from BCodePhase tomath.Ordered[BCodePhase] performed by method orderingToOrdered in scala.math.Ordered.This conversion will take place only if an implicit value of type math.Ordering[BCodePhase] is in scope.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (bCodePhase: math.Ordered[BCodePhase]).<=(that)
    Definition Classes
    Ordered
  3. def >(that: BCodePhase): Boolean
    Implicit
    This member is added by an implicit conversion from BCodePhase tomath.Ordered[BCodePhase] performed by method orderingToOrdered in scala.math.Ordered.This conversion will take place only if an implicit value of type math.Ordering[BCodePhase] is in scope.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (bCodePhase: math.Ordered[BCodePhase]).>(that)
    Definition Classes
    Ordered
  4. def >=(that: BCodePhase): Boolean
    Implicit
    This member is added by an implicit conversion from BCodePhase tomath.Ordered[BCodePhase] performed by method orderingToOrdered in scala.math.Ordered.This conversion will take place only if an implicit value of type math.Ordering[BCodePhase] is in scope.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (bCodePhase: math.Ordered[BCodePhase]).>=(that)
    Definition Classes
    Ordered
  5. def compare(that: BCodePhase): Int
    Implicit
    This member is added by an implicit conversion from BCodePhase tomath.Ordered[BCodePhase] performed by method orderingToOrdered in scala.math.Ordered.This conversion will take place only if an implicit value of type math.Ordering[BCodePhase] is in scope.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (bCodePhase: math.Ordered[BCodePhase]).compare(that)
    Definition Classes
    Ordered
  6. def compareTo(that: BCodePhase): Int
    Implicit
    This member is added by an implicit conversion from BCodePhase tomath.Ordered[BCodePhase] performed by method orderingToOrdered in scala.math.Ordered.This conversion will take place only if an implicit value of type math.Ordering[BCodePhase] is in scope.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (bCodePhase: math.Ordered[BCodePhase]).compareTo(that)
    Definition Classes
    Ordered → Comparable

Deprecated Value Members

  1. final def withCurrentUnit(unit: Global.CompilationUnit)(task: => Unit): Unit
    Definition Classes
    GlobalPhase
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13) Unused, inlined in applyPhase

  2. final def withCurrentUnitNoLog(unit: Global.CompilationUnit)(task: => Unit): Unit
    Definition Classes
    GlobalPhase
    Annotations
    @inline() @deprecated
    Deprecated

    (Since version 2.13) Unused, see withCurrentUnit