scala.tools.nsc.backend.icode.GenICode.ICodePhase

Context

class Context extends AnyRef

The Context class keeps information relative to the current state in code generation

Source
GenICode.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Context
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Context(other: Context)

  2. new Context()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def Try(body: (Context) ⇒ Context, handlers: List[(Symbol, TypeKind, (Context) ⇒ Context)], finalizer: Tree, tree: Tree): Context

    Generate exception handlers for the body.

    Generate exception handlers for the body. Body is evaluated with a context where all the handlers are active. Handlers are evaluated in the 'outer' context.

    It returns the resulting context, with the same active handlers as before the call. Use it like:

    ctx.Try( ctx => { ctx.bb.emit(...) // protected block }, (ThrowableClass, ctx => { ctx.bb.emit(...); // exception handler }), (AnotherExceptionClass, ctx => {... } ))

  7. def TryMsil(body: (Context) ⇒ Context, handlers: List[(Symbol, TypeKind, (Context) ⇒ Context)], finalizer: Tree, tree: Tree): Context

    try-catch-finally blocks are actually simpler to emit in MSIL, because there is support for finally in bytecode.

    try-catch-finally blocks are actually simpler to emit in MSIL, because there is support for finally in bytecode.

    A try { .. } catch { .. } finally { .. } block is de-sugared into try { try { ..} catch { .. } } finally { .. }

    In ICode finally block is represented exactly the same as an exception handler, but with NoSymbol as the exception class. The covered blocks are all blocks of the try { .. } catch { .. }.

    Also, TryMsil does not enter any Finalizers into the cleanups', because the CLI takes care of running the finalizer when seeing a leave' statement inside a try / catch.

  8. def addFinalizer(f: Tree, ctx: Context): Context.this.type

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. var bb: BasicBlock

    The current basic block.

  11. var clazz: IClass

    The current class.

  12. var cleanups: List[Cleanup]

    The current monitors or finalizers, to be cleaned up upon return'.

  13. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. var currentExceptionHandlers: List[ExceptionHandler]

    The exception handlers we are currently generating code for

  15. var defdef: DefDef

    Current method definition.

  16. def dup: Context

    Clone the current context

  17. def endHandler(): Unit

  18. def enterMethod(m: IMethod, d: DefDef): Context

    Prepare a new context upon entry into a method.

    Prepare a new context upon entry into a method.

    m

    ...

    d

    ...

    returns

    ...

  19. def enterScope(): Unit

  20. def enterSynchronized(monitor: Local): Context.this.type

  21. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  23. def exitScope(): Unit

  24. def exitSynchronized(monitor: Local): Context.this.type

  25. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  27. var handlerCount: Int

  28. var handlers: List[ExceptionHandler]

    current exception handlers

  29. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  30. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  31. var labels: HashMap[Symbol, Label]

    Map from label symbols to label objects.

  32. def loadException(ctx: Context, exh: ExceptionHandler, pos: Position): Unit

  33. def makeLocal(pos: Position, tpe: Type, name: String): Local

    Make a fresh local variable.

    Make a fresh local variable. It ensures the 'name' is unique.

  34. var method: IMethod

    The current method.

  35. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  36. def newBlock: Context

    Return a new context for a new basic block.

  37. final def notify(): Unit

    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  39. var packg: Name

    The current package.

  40. def removeActiveHandler(exh: ExceptionHandler): Unit

    Remove the given handler from the list of active exception handlers.

  41. def removeFinalizer(f: Tree): Context.this.type

  42. var scope: Scope

    The current local variable scope.

  43. def setBasicBlock(b: BasicBlock): Context.this.type

  44. def setClass(c: IClass): Context.this.type

  45. def setMethod(m: IMethod): Context.this.type

  46. def setPackage(p: Name): Context.this.type

  47. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  48. def toString(): String

    Definition Classes
    Context → AnyRef → Any
  49. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  50. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  51. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any