Dotty Documentation

0.14.0-bin-SNAPSHOT

class CoreBTypes [ BTFS ]
extends Object

Core BTypes and some other definitions. The initialization of these definitions requies access to symbols / types (global).

The symbols used to initialize the ClassBTypes may change from one compiler run to the next. To make sure the definitions are consistent with the symbols in the current run, the intializeCoreBTypes method in BTypesFromSymbols creates a new instance of CoreBTypes in each compiler run.

The class BTypesFromSymbols does not directly reference CoreBTypes, but CoreBTypesProxy. The reason is that having a var bTypes: CoreBTypes would not allow import bTypes._. Instead, the proxy class holds a CoreBTypes in a variable field and forwards to this instance.

The definitions in CoreBTypes need to be lazy vals to break an initialization cycle. When creating a new instance to assign to the proxy, the classBTypeFromSymbol invoked in the constructor will actucally go through the proxy. The lazy vals make sure the instance is assigned in the proxy before the fields are initialized.

Note: if we did not re-create the core BTypes on each compiler run, BType.classBTypeFromInternalNameMap could not be a perRunCache anymore: the classes defeined here need to be in that map, they are added when the ClassBTypes are created. The per run cache removes them, so they would be missing in the second run.

[-] Constructors

CoreBTypes ( bTypes: BTFS )

[-] Members

[+] lazy val AbstractFunctionArityMap : Map [ ClassBType, Int ]
[+] lazy val AbstractFunctionReference : Vector [ ClassBType ]
[+] lazy val AbstractPartialFunctionReference : ClassBType
[+] lazy val BOXED_BOOLEAN : ClassBType
[+] lazy val BOXED_BYTE : ClassBType
[+] lazy val BOXED_CHAR : ClassBType
[+] lazy val BOXED_DOUBLE : ClassBType
[+] lazy val BOXED_FLOAT : ClassBType
[+] lazy val BOXED_INT : ClassBType
[+] lazy val BOXED_LONG : ClassBType
[+] lazy val BOXED_SHORT : ClassBType
[+] lazy val BOXED_UNIT : ClassBType
[+] lazy val BoxesRunTime : ClassBType
[+] lazy val FunctionReference : Vector [ ClassBType ]
[+] lazy val ObjectReference : ClassBType
[+] lazy val PartialFunctionReference : ClassBType
[+] lazy val RT_NOTHING : ClassBType
[+] lazy val RT_NULL : ClassBType
[+] lazy val StringRef : ClassBType
[+] lazy val ThrowableReference : ClassBType
[+] lazy val asmBoxTo : Map [ BType, MethodNameAndType ]

Methods in scala.runtime.BoxesRuntime

[+] lazy val asmUnboxTo : Map [ BType, MethodNameAndType ]
[+] val bTypes : BTFS
[+] lazy val boxResultType : Map [ Symbol, ClassBType ]

Maps the method symbol for a box method to the boxed type of the result. For example, the method symbol for Byte.box() is mapped to the ClassBType java/lang/Byte.

[+] lazy val boxedClassOfPrimitive : Map [ PrimitiveBType, ClassBType ]

Map from primitive types to their boxed class type. Useful when pushing class literals onto the operand stack (ldc instruction taking a class literal), see genConstant.

[+] lazy val boxedClasses : Set [ ClassBType ]
[+] lazy val classCastExceptionReference : ClassBType
[+] lazy val jioSerializableReference : ClassBType
[+] lazy val jlCharSequenceRef : ClassBType
[+] lazy val jlCloneableReference : ClassBType
[+] lazy val jlIllegalArgExceptionRef : ClassBType
[+] lazy val jlNPEReference : ClassBType
[+] lazy val jlStringBufferRef : ClassBType
[+] lazy val jlStringBuilderRef : ClassBType
[+] lazy val jliSerializedLambdaRef : ClassBType
[+] lazy val objArrayReference : ArrayBType
[+] lazy val primitiveTypeMap : Map [ Symbol, PrimitiveBType ]

Maps primitive types to their corresponding PrimitiveBType. The map is defined lexically above the first use of classBTypeFromSymbol because that method looks at the map.

[+] lazy val scalaSerializableReference : ClassBType
[+] lazy val srBooleanRef : ClassBType
[+] lazy val srByteRef : ClassBType
[+] lazy val srCharRef : ClassBType
[+] lazy val srDoubleRef : ClassBType
[+] lazy val srFloatRef : ClassBType
[+] lazy val srIntRef : ClassBType
[+] lazy val srLongRef : ClassBType
[+] lazy val typeOfArrayOp : Map [ Int, BType ]
[+] lazy val unboxResultType : Map [ Symbol, PrimitiveBType ]

Maps the method symbol for an unbox method to the primitive type of the result. For example, the method symbol for Byte.unbox()) is mapped to the PrimitiveBType BYTE.