JVM_IR: use ConcurrentHashMap
Replace mutable maps and sets accessed from by-file lowerings with ConcurrentHashMap, so that lowerings can operate on them in parallel.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
package org.jetbrains.kotlin.backend.common
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import kotlin.reflect.KMutableProperty0
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
@@ -47,7 +48,7 @@ open class DefaultMapping : Mapping {
|
||||
override val reflectedNameAccessor: Mapping.Delegate<IrClass, IrSimpleFunction> = newMapping()
|
||||
|
||||
protected open fun <K : IrDeclaration, V> newMapping() = object : Mapping.Delegate<K, V>() {
|
||||
private val map: MutableMap<K, V> = mutableMapOf()
|
||||
private val map: MutableMap<K, V> = ConcurrentHashMap()
|
||||
|
||||
override operator fun get(key: K): V? {
|
||||
return map[key]
|
||||
|
||||
Reference in New Issue
Block a user