IR: only worry about threads in JvmIrSignatureDescriptor
General IdSignatureDescriptor is used from other backends, which have no multi-threaded backend for now and do not need to carry the associated runtime costs. So IdSignatureDescriptor keeps the thread-unsafe caching of signature builder.
This commit is contained in:
+4
-2
@@ -105,15 +105,17 @@ open class IdSignatureDescriptor(private val mangler: KotlinMangler.DescriptorMa
|
||||
reportUnexpectedDescriptor(descriptor)
|
||||
}
|
||||
|
||||
private val composer by lazy { createSignatureBuilder() }
|
||||
|
||||
override fun composeSignature(descriptor: DeclarationDescriptor): IdSignature? {
|
||||
return if (mangler.run { descriptor.isExported() }) {
|
||||
createSignatureBuilder().buildSignature(descriptor)
|
||||
composer.buildSignature(descriptor)
|
||||
} else null
|
||||
}
|
||||
|
||||
override fun composeEnumEntrySignature(descriptor: ClassDescriptor): IdSignature? {
|
||||
return if (mangler.run { descriptor.isExportEnumEntry() }) {
|
||||
createSignatureBuilder().buildSignature(descriptor)
|
||||
composer.buildSignature(descriptor)
|
||||
} else null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user