[K/N] Fixed wrong initializer call extraction for interop-visible functions
#KT-56521 Fixed
This commit is contained in:
+5
-5
@@ -162,13 +162,13 @@ internal object StaticInitializersOptimization {
|
|||||||
val containter = function.calledInitializer ?: return@forEach
|
val containter = function.calledInitializer ?: return@forEach
|
||||||
val backingField = (function as? IrSimpleFunction)?.correspondingPropertySymbol?.owner?.backingField
|
val backingField = (function as? IrSimpleFunction)?.correspondingPropertySymbol?.owner?.backingField
|
||||||
val isDefaultAccessor = backingField != null && function.origin == IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR
|
val isDefaultAccessor = backingField != null && function.origin == IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR
|
||||||
if ((!functionInitializedFiles.get(containerIds[containter]!!)
|
val initializerCallCouldBeDropped =
|
||||||
&& function !in functionsWhoseInitializerCallCanBeExtractedToCallSites
|
functionInitializedFiles.get(containerIds[containter]!!)
|
||||||
|
|| function in functionsWhoseInitializerCallCanBeExtractedToCallSites
|
||||||
// Extract calls to file initializers off of default accessors to simplify their inlining.
|
// Extract calls to file initializers off of default accessors to simplify their inlining.
|
||||||
&& (!isDefaultAccessor || function in rootSet))
|
|| isDefaultAccessor
|
||||||
) {
|
if (function in rootSet || !initializerCallCouldBeDropped)
|
||||||
result += function
|
result += function
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user