scala.tools.nsc.backend.msil.GenMSIL

BytecodeGenerator

class BytecodeGenerator extends AnyRef

MSIL bytecode generator.

Source
GenMSIL.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. BytecodeGenerator
  2. AnyRef
  3. Any
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. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  6. val CloneableAttr: Type

  7. val EXCEPTION: Type

  8. val ICLONEABLE: Type

  9. val INT_PTR: Type

  10. val JOBJECT: Symbol

  11. val JSTRING: Symbol

  12. val MBYTE_ARRAY: Type

  13. val MEMBERWISE_CLONE: MethodInfo

  14. val MMONITOR: Type

  15. val MMONITOR_ENTER: MethodInfo

  16. val MMONITOR_EXIT: MethodInfo

  17. val MODULE_INSTANCE_NAME: String

  18. val MSTRING_BUILDER: Type

  19. val MSTRING_BUILDER_CONSTR: ConstructorInfo

  20. val MSTRING_BUILDER_TOSTRING: MethodInfo

  21. val SerializableAttr: Type

  22. val SystemConvert: Type

  23. val TYPE_FROM_HANDLE: MethodInfo

  24. val TransientAtt: Type

  25. def addAttributes(member: ICustomAttributeSetter, annotations: List[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.

  26. def addSymtabAttribute(sym: 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)

  27. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  28. var assemName: String

  29. val beginCatchBlock: HashMap[BasicBlock, ExceptionHandler]

  30. val beginExBlock: HashMap[BasicBlock, List[ExceptionHandler]]

  31. val boxedUnit: FieldInfo

  32. var clasz: IClass

  33. def clone(): AnyRef

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

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

  35. def createClassMembers(iclass: IClass): Unit

  36. def createClassMembers0(iclass: IClass): Unit

  37. def createTypeBuilder(iclass: IClass): Unit

  38. var currentHandlers: Stack[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
  39. def customModifiers(annotations: List[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).

  40. var dbFilenameSeen: Boolean

  41. var delegateCallers: TypeBuilder

  42. val dynToStatMapped: HashSet[Symbol]

  43. def emitBox(code: ILGenerator, boxType: TypeKind): Unit

  44. def emitBr(condition: TestOp, dest: Label, isFloat: Boolean): Unit

  45. def emitBrBool(cond: TestOp, dest: Label): Unit

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

  47. def emitUnbox(code: ILGenerator, boxType: TypeKind): Unit

  48. val endExBlock: HashMap[BasicBlock, List[ExceptionHandler]]

  49. val endFinallyLabels: HashMap[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.

  50. var entryPoint: Symbol

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

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

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

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

  55. def genBlock(block: BasicBlock, prev: BasicBlock, next: BasicBlock): Unit

    block

    the BasicBlock to emit code for

    next

    the following BasicBlock, null if block is the last one

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

  57. def genCode(m: IMethod): Unit

  58. def genPrimitive(primitive: Primitive, pos: Position): Unit

  59. final def getClass(): java.lang.Class[_]

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

  61. def getType(sym: Symbol): Type

  62. def getTypeOpt(sym: 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

  63. var handlerReturnKind: TypeKind

  64. var handlerReturnLabel: Label

  65. var handlerReturnLocal: LocalBuilder

  66. var handlerReturnMethod: IMethod

  67. def hashCode(): Int

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

  69. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  70. val labels: HashMap[BasicBlock, Label]

  71. def leavesHandler(from: BasicBlock, to: 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)
  72. def loadArg(code: ILGenerator, loadAddr: Boolean)(i: Int): Unit

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

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

  75. val localBuilders: HashMap[Local, LocalBuilder]

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

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

  78. var massembly: AssemblyBuilder

  79. var mcode: ILGenerator

  80. var method: IMethod

  81. var mmodule: ModuleBuilder

  82. var moduleName: String

  83. def moduleSuffix(sym: Symbol): String

    cut&pasted from GenJVM

  84. def msilFieldFlags(sym: Symbol): Short

  85. val msilLinearizer: 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.

  86. def msilMethodFlags(sym: Symbol): Short

  87. def msilName(sym: 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.

  88. def msilTypeFlags(sym: Symbol): Int

  89. var nbDelegateCallers: Int

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

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

  92. val notInitializedModules: HashSet[Symbol]

  93. final def notify(): Unit

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

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

  96. var outDir: File

  97. def returnFromHandler(kind: TypeKind): (LocalBuilder, Label)

  98. var srcPath: File

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

    Definition Classes
    AnyRef
  100. val toBool: MethodInfo

  101. val toChar: MethodInfo

  102. val toDouble: MethodInfo

  103. val toFloat: MethodInfo

  104. val toInt: MethodInfo

  105. val toLong: MethodInfo

  106. val toSByte: MethodInfo

  107. val toShort: MethodInfo

  108. def toString(): String

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

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

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

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

Inherited from AnyRef

Inherited from Any