JVM_IR: don't regenerate objects in lambdas inlined into objects

This commit is contained in:
pyos
2019-10-30 11:32:28 +01:00
committed by max-kammerer
parent eeadc95bc1
commit a835f07d51
21 changed files with 11 additions and 37 deletions
@@ -70,7 +70,13 @@ open class InliningContext(
nameGenerator.subGenerator("lambda"),
//mark lambda inlined
hashMapOf(lambdaInfo.lambdaClassType.internalName to null),
lambdaInfo
lambdaInfo,
// TODO we also want this for the old backend (KT-28064), but this changes EnclosingMethod of objects
// in inline lambdas, so use a language version flag.
if (state.isIrBackend)
false // Do not regenerate objects in lambdas inlined into regenerated objects unless needed for some other reason.
else
classRegeneration
)
fun subInlineWithClassRegeneration(
@@ -86,7 +92,8 @@ open class InliningContext(
fun subInline(
generator: NameGenerator,
additionalTypeMappings: Map<String, String?> = emptyMap(),
lambdaInfo: LambdaInfo? = this.lambdaInfo
lambdaInfo: LambdaInfo? = this.lambdaInfo,
classRegeneration: Boolean = this.classRegeneration
): InliningContext {
val isInliningLambda = lambdaInfo != null
return InliningContext(