|
6 | 6 | package scala.tools.nsc
|
7 | 7 | package backend.jvm
|
8 | 8 |
|
9 |
| -import scala.collection.concurrent.TrieMap |
10 | 9 | import scala.collection.{concurrent, mutable}
|
11 | 10 | import scala.tools.asm
|
12 | 11 | import scala.tools.asm.Opcodes
|
@@ -41,8 +40,8 @@ abstract class BTypes {
|
41 | 40 |
|
42 | 41 | // Concurrent maps because stack map frames are computed when in the class writer, which
|
43 | 42 | // might run on multiple classes concurrently.
|
44 |
| - val classBTypeCacheFromSymbol: concurrent.Map[InternalName, ClassBType] = recordPerRunCache(TrieMap.empty) |
45 |
| - val classBTypeCacheFromClassfile: concurrent.Map[InternalName, ClassBType] = recordPerRunCache(TrieMap.empty) |
| 43 | + val classBTypeCacheFromSymbol: concurrent.Map[InternalName, ClassBType] = recordPerRunCache(FlatConcurrentHashMap.empty) |
| 44 | + val classBTypeCacheFromClassfile: concurrent.Map[InternalName, ClassBType] = recordPerRunCache(FlatConcurrentHashMap.empty) |
46 | 45 |
|
47 | 46 | /**
|
48 | 47 | * A BType is either a primitive type, a ClassBType, an ArrayBType of one of these, or a MethodType
|
@@ -1030,3 +1029,8 @@ object BTypes {
|
1030 | 1029 | // when inlining, local variable names of the callee are prefixed with the name of the callee method
|
1031 | 1030 | val InlinedLocalVariablePrefixMaxLenght = 128
|
1032 | 1031 | }
|
| 1032 | +object FlatConcurrentHashMap { |
| 1033 | + import collection.JavaConverters._ |
| 1034 | + def empty[K,V]: concurrent.Map[K,V] = |
| 1035 | + new java.util.concurrent.ConcurrentHashMap[K,V].asScala |
| 1036 | +} |
0 commit comments