Move isCompilingAgainstJdk8OrLater to JvmBackendContext
This should solve multi-thread synchronization problem Probably #KT-55483 Fixed
This commit is contained in:
committed by
Space Team
parent
ac28c0a286
commit
fc95889115
+1
-5
@@ -39,12 +39,8 @@ internal val additionalClassAnnotationPhase = makeIrFilePhase(
|
|||||||
|
|
||||||
private class AdditionalClassAnnotationLowering(private val context: JvmBackendContext) : ClassLoweringPass {
|
private class AdditionalClassAnnotationLowering(private val context: JvmBackendContext) : ClassLoweringPass {
|
||||||
private val symbols = context.ir.symbols.javaAnnotations
|
private val symbols = context.ir.symbols.javaAnnotations
|
||||||
private val isCompilingAgainstJdk8OrLater =
|
|
||||||
context.state.jvmBackendClassResolver.resolveToClassDescriptors(
|
|
||||||
Type.getObjectType("java/lang/invoke/LambdaMetafactory")
|
|
||||||
).isNotEmpty()
|
|
||||||
private val noNewJavaAnnotationTargets =
|
private val noNewJavaAnnotationTargets =
|
||||||
context.state.noNewJavaAnnotationTargets || !isCompilingAgainstJdk8OrLater
|
context.state.noNewJavaAnnotationTargets || !context.isCompilingAgainstJdk8OrLater
|
||||||
|
|
||||||
override fun lower(irClass: IrClass) {
|
override fun lower(irClass: IrClass) {
|
||||||
if (!irClass.isAnnotationClass) return
|
if (!irClass.isAnnotationClass) return
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ class JvmBackendContext(
|
|||||||
|
|
||||||
private val localClassType = ConcurrentHashMap<IrAttributeContainer, Type>()
|
private val localClassType = ConcurrentHashMap<IrAttributeContainer, Type>()
|
||||||
|
|
||||||
|
val isCompilingAgainstJdk8OrLater = state.jvmBackendClassResolver.resolveToClassDescriptors(
|
||||||
|
Type.getObjectType("java/lang/invoke/LambdaMetafactory")
|
||||||
|
).isNotEmpty()
|
||||||
|
|
||||||
fun getLocalClassType(container: IrAttributeContainer): Type? =
|
fun getLocalClassType(container: IrAttributeContainer): Type? =
|
||||||
localClassType[container.attributeOwnerId]
|
localClassType[container.attributeOwnerId]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user