scala.tools.nsc.backend.msil.GenMSIL

BytecodeGenerator

class BytecodeGenerator extends AnyRef

MSIL bytecode generator.

Source
GenMSIL.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BytecodeGenerator
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BytecodeGenerator()

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. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (BytecodeGenerator, B)

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to ArrowAssoc[BytecodeGenerator] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  8. val CloneableAttr: Global.Type

  9. val EXCEPTION: Type

  10. val ICLONEABLE: Type

  11. val INT_PTR: Type

  12. val JOBJECT: Global.ClassSymbol

  13. val JSTRING: Global.ClassSymbol

  14. val MBYTE_ARRAY: Type

  15. val MEMBERWISE_CLONE: MethodInfo

  16. val MMONITOR: Type

  17. val MMONITOR_ENTER: MethodInfo

  18. val MMONITOR_EXIT: MethodInfo

  19. val MODULE_INSTANCE_NAME: String

  20. val MSTRING_BUILDER: Type

  21. val MSTRING_BUILDER_CONSTR: ConstructorInfo

  22. val MSTRING_BUILDER_TOSTRING: MethodInfo

  23. val SerializableAttr: Global.Type

  24. val SystemConvert: Type

  25. val TYPE_FROM_HANDLE: MethodInfo

  26. val TransientAtt: Global.Type

  27. def addAttributes(member: ICustomAttributeSetter, annotations: List[Global.AnnotationInfo]): Unit

    Mutates member adding CLR attributes (if any) based on sym.

    Mutates member adding CLR attributes (if any) based on sym.annotations. Please notice that CLR custom modifiers are a different beast (see customModifiers below) and thus shouldn't be added by this method.

  28. def addSymtabAttribute(sym: Global.Symbol, tBuilder: TypeBuilder): Unit

    Form of the custom Attribute parameter (Ecma-335.

    Form of the custom Attribute parameter (Ecma-335.pdf)

    • p. 163 for CustomAttrib Form,
    • p. 164 for FixedArg Form (Array and Element) (if array or not is known!) !! least significant byte first if values longer than one byte !!

    1: Prolog (unsigned int16, value 0x0001) -> symtab[0] = 0x01, symtab[1] = 0x00 2: FixedArgs (directly the data, get number and types from related constructor) 2.1: length of the array (unsigned int32, 4 bytes, least significant first) 2.2: the byte array data 3: NumNamed (unsigned int16, number of named fields and properties, 0x0000)

  29. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  30. var assemName: String

  31. val beginCatchBlock: HashMap[Global.icodes.BasicBlock, Global.icodes.ExceptionHandler]

  32. val beginExBlock: HashMap[Global.icodes.BasicBlock, collection.immutable.List[Global.icodes.ExceptionHandler]]

  33. val boxedUnit: FieldInfo

  34. var clasz: Global.icodes.IClass

  35. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  36. def computeLocalVarsIndex(m: Global.icodes.IMethod): Unit

    Compute the indexes of each local variable of the given method.

  37. def createClassMembers(iclass: Global.icodes.IClass): Unit

  38. def createClassMembers0(iclass: Global.icodes.IClass): Unit

  39. def createTypeBuilder(iclass: Global.icodes.IClass): Unit

  40. var currentHandlers: Stack[Global.icodes.ExceptionHandler]

    When emitting the code (genBlock), the number of currently active try / catch blocks.

    When emitting the code (genBlock), the number of currently active try / catch blocks. When seeing a RETURN inside a try / catch, we need to

    • store the result in a local (if it's not UNIT)
    • emit Leave handlerReturnLabel instead of the Return
    • emit code at the end: load the local and return its value
  41. def customModifiers(annotations: List[Global.AnnotationInfo]): Array[CustomModifier]

    What's a CLR custom modifier? Intro available as source comments in compiler.

    What's a CLR custom modifier? Intro available as source comments in compiler.msil.CustomModifier. It's basically a marker associated with a location (think of FieldInfo, ParameterInfo, and PropertyInfo) and thus that marker (be it optional or required) becomes part of the signature of that location. Some annotations will become CLR attributes (see addAttributes above), others custom modifiers (this method).

  42. var dbFilenameSeen: Boolean

  43. var delegateCallers: TypeBuilder

  44. val dynToStatMapped: HashSet[Global.Symbol]

  45. def emitBox(code: ILGenerator, boxType: Global.icodes.TypeKind): Unit

  46. def emitBr(condition: Global.icodes.TestOp, dest: Label, isFloat: Boolean): Unit

  47. def emitBrBool(cond: Global.icodes.TestOp, dest: Label): Unit

  48. def emitCondBr(block: Global.icodes.BasicBlock, cond: Global.icodes.TestOp, success: Global.icodes.BasicBlock, failure: Global.icodes.BasicBlock, next: Global.icodes.BasicBlock, emitBrFun: (Global.icodes.TestOp, Label) ⇒ Unit): Unit

  49. def emitUnbox(code: ILGenerator, boxType: Global.icodes.TypeKind): Unit

  50. val endExBlock: HashMap[Global.icodes.BasicBlock, collection.immutable.List[Global.icodes.ExceptionHandler]]

  51. val endFinallyLabels: HashMap[Global.icodes.ExceptionHandler, Label]

    For try/catch nested inside a finally, we can't use Leave OutsideFinally, the Leave target has to be inside the finally (and it has to be the endfinally instruction).

    For try/catch nested inside a finally, we can't use Leave OutsideFinally, the Leave target has to be inside the finally (and it has to be the endfinally instruction). So for every finalizer, we have a label which marks the place of the endfinally, nested try/catch blocks will leave there.

  52. def ensuring(cond: (BytecodeGenerator) ⇒ Boolean, msg: ⇒ Any): BytecodeGenerator

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to Ensuring[BytecodeGenerator] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  53. def ensuring(cond: (BytecodeGenerator) ⇒ Boolean): BytecodeGenerator

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to Ensuring[BytecodeGenerator] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  54. def ensuring(cond: Boolean, msg: ⇒ Any): BytecodeGenerator

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to Ensuring[BytecodeGenerator] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  55. def ensuring(cond: Boolean): BytecodeGenerator

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to Ensuring[BytecodeGenerator] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  56. var entryPoint: Global.Symbol

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

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

    Definition Classes
    AnyRef → Any
  59. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  60. var firstSourceName: String

  61. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  62. def genBlock(block: Global.icodes.BasicBlock, prev: Global.icodes.BasicBlock, next: Global.icodes.BasicBlock): Unit

    block

    the BasicBlock to emit code for

    next

    the following BasicBlock, null if block is the last one

  63. def genBlocks(blocks: List[Global.icodes.BasicBlock], previous: Global.icodes.BasicBlock = null): Unit

  64. def genCode(m: Global.icodes.IMethod): Unit

  65. def genPrimitive(primitive: Global.icodes.Primitive, pos: Global.Position): Unit

  66. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  67. def getConstructor(sym: Global.Symbol): ConstructorInfo

  68. def getType(sym: Global.Symbol): Type

  69. def getTypeOpt(sym: Global.Symbol): Option[Type]

    Get an MSIL type from a symbol.

    Get an MSIL type from a symbol. First look in the clrTypes.types map, then lookup the name using clrTypes.getType

  70. var handlerReturnKind: Global.icodes.TypeKind

  71. var handlerReturnLabel: Label

  72. var handlerReturnLocal: LocalBuilder

  73. var handlerReturnMethod: Global.icodes.IMethod

  74. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  75. def initAssembly(): Unit

  76. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  77. val labels: HashMap[Global.icodes.BasicBlock, Label]

  78. def leavesHandler(from: Global.icodes.BasicBlock, to: Global.icodes.BasicBlock): (Boolean, Boolean, Option[Label])

    Returns a Triple (Boolean, Boolean, Option[Label])

    Returns a Triple (Boolean, Boolean, Option[Label])

    • whether the jump leaves some exception block (try / catch / finally)
    • whether it leaves a finally handler (finally block, but not it's try / catch)
    • a label where to jump for leaving the finally handler . None to leave directly using endfinally . Some(label) to emit leave label (for try / catch inside a finally handler)
  79. def loadArg(code: ILGenerator, loadAddr: Boolean)(i: Int): Unit

  80. def loadI4(value: Int, code: ILGenerator): Unit

  81. def loadLocal(i: Int, local: Global.icodes.Local, code: ILGenerator, loadAddr: Boolean): Unit

  82. val localBuilders: HashMap[Global.icodes.Local, LocalBuilder]

  83. def mapConstructor(sym: Global.Symbol, cInfo: ConstructorInfo): Unit

  84. def mapType(sym: Global.Symbol, mType: Type): Unit

  85. var massembly: AssemblyBuilder

  86. var mcode: ILGenerator

  87. var method: Global.icodes.IMethod

  88. var mmodule: ModuleBuilder

  89. var moduleName: String

  90. def msilFieldFlags(sym: Global.Symbol): Short

  91. val msilLinearizer: Global.icodes.MSILLinearizer

    Special linearizer for methods with at least one exception handler.

    Special linearizer for methods with at least one exception handler. This linearizer brings all basic blocks in the right order so that nested try-catch and try-finally blocks can be emitted.

  92. def msilMethodFlags(sym: Global.Symbol): Short

  93. def msilName(sym: Global.Symbol): String

    Return the a name of this symbol that can be used on the .

    Return the a name of this symbol that can be used on the .NET platform. It removes spaces from names.

    Special handling: scala.All and scala.AllRef are 'erased' to scala.All$ and scala.AllRef$. This is needed because they are not real classes, and they mean 'abrupt termination upon evaluation of that expression' or 'null' respectively. This handling is done already in GenICode, but here we need to remove references from method signatures to these types, because such classes can not exist in the classpath: the type checker will be very confused.

  94. def msilTypeFlags(sym: Global.Symbol): Int

  95. var nbDelegateCallers: Int

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

    Definition Classes
    AnyRef
  97. def nestingAwareFullClassname(csym: Global.Symbol): String

  98. val notInitializedModules: HashSet[Global.Symbol]

  99. final def notify(): Unit

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

    Definition Classes
    AnyRef
  101. val objParam: Array[Type]

  102. var outDir: File

  103. def returnFromHandler(kind: Global.icodes.TypeKind): (LocalBuilder, Label)

  104. var srcPath: File

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

    Definition Classes
    AnyRef
  106. val toBool: MethodInfo

  107. val toChar: MethodInfo

  108. val toDouble: MethodInfo

  109. val toFloat: MethodInfo

  110. val toInt: MethodInfo

  111. val toLong: MethodInfo

  112. val toSByte: MethodInfo

  113. val toShort: MethodInfo

  114. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  118. def writeAssembly(): Unit

  119. def [B](y: B): (BytecodeGenerator, B)

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to ArrowAssoc[BytecodeGenerator] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implict Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bytecodeGenerator: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bytecodeGenerator: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: BytecodeGenerator

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to ArrowAssoc[BytecodeGenerator] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bytecodeGenerator: ArrowAssoc[BytecodeGenerator]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: BytecodeGenerator

    Implicit information
    This member is added by an implicit conversion from BytecodeGenerator to Ensuring[BytecodeGenerator] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bytecodeGenerator: Ensuring[BytecodeGenerator]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from BytecodeGenerator to StringAdd

Inherited by implicit conversion any2stringfmt from BytecodeGenerator to StringFormat

Inherited by implicit conversion any2ArrowAssoc from BytecodeGenerator to ArrowAssoc[BytecodeGenerator]

Inherited by implicit conversion any2Ensuring from BytecodeGenerator to Ensuring[BytecodeGenerator]

Ungrouped