summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2014-12-11 18:03:00 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2015-01-16 23:18:12 +0100
commitff9512812c6619d6ab5a1dde99c9569a3b27c813 (patch)
tree2df773f7a55912a2946a6ea8d0faa4e675b0997e /src/compiler
parent45efefaa9b16532c1f61560bde09a7346dcfe5a1 (diff)
downloadscala-ff9512812c6619d6ab5a1dde99c9569a3b27c813.tar.gz
scala-ff9512812c6619d6ab5a1dde99c9569a3b27c813.tar.bz2
scala-ff9512812c6619d6ab5a1dde99c9569a3b27c813.zip
Remove an unnecessary hash map in BTypesFromSymbols
There's already the map classBTypeFromInternalNameMap in BTypes which stores all ClassBTypes.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
index ef18d29841..0582088710 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala
@@ -41,11 +41,6 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
global.perRunCaches.recordCache(collection.concurrent.TrieMap.empty[InternalName, ClassBType])
}
- /**
- * Cache for the method classBTypeFromSymbol.
- */
- private val convertedClasses = perRunCaches.newMap[Symbol, ClassBType]()
-
// helpers that need access to global.
// TODO @lry create a separate component, they don't belong to BTypesFromSymbols
@@ -88,13 +83,11 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
(classSym != NothingClass && classSym != NullClass),
s"Cannot create ClassBType for special class symbol ${classSym.fullName}")
- convertedClasses.getOrElse(classSym, {
- val internalName = classSym.javaBinaryName.toString
- // We first create and add the ClassBType to the hash map before computing its info. This
- // allows initializing cylic dependencies, see the comment on variable ClassBType._info.
- val classBType = ClassBType(internalName)
- convertedClasses(classSym) = classBType
- setClassInfo(classSym, classBType)
+ val internalName = classSym.javaBinaryName.toString
+ classBTypeFromInternalNameMap.getOrElse(internalName, {
+ // The new ClassBType is added to the map in its constructor, before we set its info. This
+ // allows initializing cyclic dependencies, see the comment on variable ClassBType._info.
+ setClassInfo(classSym, ClassBType(internalName))
})
}