summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2014-08-13 10:30:27 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2014-08-19 17:54:22 +0200
commit22295833c33298064b40469a1ff0e491be5f80a1 (patch)
tree4da665cca0e30334aa855f20fd5799c56298aebf /src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala
parent53437e61305d656c115c94b25845c8f8dd7342ca (diff)
downloadscala-22295833c33298064b40469a1ff0e491be5f80a1.tar.gz
scala-22295833c33298064b40469a1ff0e491be5f80a1.tar.bz2
scala-22295833c33298064b40469a1ff0e491be5f80a1.zip
Integrate CoreBTypes by composition (not inheritance), non-var fields
Make the fields of CoreBTypes non-variable. Instead, replace the CoreBTypes instance on each compiler run. That results in fewer variables, and the initialization code is directly where the fields are declared, instead of an init method.
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala
index 390de5fae1..389dbe43eb 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala
@@ -42,6 +42,12 @@ abstract class BTypes {
*/
def classBTypeFromInternalName(internalName: String) = classBTypeFromInternalNameMap(internalName)
+ // Some core BTypes are required here, in class BType, where no Global instance is available.
+ // The Global is only available in the subclass BTypesFromSymbols. We cannot depend on the actual
+ // implementation (CoreBTypesProxy) here because it has members that refer to global.Symbol.
+ val coreBTypes: CoreBTypesProxyGlobalIndependent[this.type]
+ import coreBTypes._
+
/**
* A BType is either a primitve type, a ClassBType, an ArrayBType of one of these, or a MethodType
* referring to BTypes.
@@ -834,14 +840,10 @@ abstract class BTypes {
* They are defs (not vals) because they are implemented using vars (see comment on CoreBTypes).
*/
- def boxedClasses: Set[ClassBType]
-
- def RT_NOTHING : ClassBType
- def RT_NULL : ClassBType
-
- def ObjectReference : ClassBType
- def jlCloneableReference : ClassBType
- def jioSerializableReference : ClassBType
+ /**
+ * Just a named pair, used in CoreBTypes.asmBoxTo/asmUnboxTo.
+ */
+ final case class MethodNameAndType(name: String, methodType: MethodBType)
/**
* True if the current compilation unit is of a primitive class (scala.Boolean et al).