JVM_IR: only serialize inline functions themselves with -Xserialize-ir=inline

This commit is contained in:
Georgy Bronnikov
2021-09-15 21:34:56 +03:00
committed by TeamCityServer
parent 4caa71538d
commit a9ce25cf33
12 changed files with 951 additions and 2379 deletions
@@ -119,9 +119,7 @@ class IrLazyClass(
override fun loadIr(): Boolean {
assert(parent is IrPackageFragment)
irLoaded?.let { return it }
return stubGenerator.extensions.deserializeLazyClass(
this, stubGenerator, parent, allowErrorNodes = false
).also { irLoaded = it }
return irLoaded ?:
stubGenerator.extensions.deserializeClass(this, stubGenerator, parent, allowErrorNodes = false).also { irLoaded = it }
}
}
@@ -39,13 +39,15 @@ interface IrLazyDeclarationBase : IrDeclaration {
descriptor.annotations.mapNotNull(typeTranslator.constantValueGenerator::generateAnnotationConstructorCall).toMutableList()
}
fun createLazyParent(): ReadWriteProperty<Any?, IrDeclarationParent> = lazyVar(stubGenerator.lock) {
fun createLazyParent(): ReadWriteProperty<Any?, IrDeclarationParent> = lazyVar(stubGenerator.lock, ::lazyParent)
fun lazyParent(): IrDeclarationParent {
val currentDescriptor = descriptor
val containingDeclaration =
((currentDescriptor as? PropertyAccessorDescriptor)?.correspondingProperty ?: currentDescriptor).containingDeclaration
when (containingDeclaration) {
return when (containingDeclaration) {
is PackageFragmentDescriptor -> run {
val parent = this.takeUnless { it is IrClass }?.let {
stubGenerator.generateOrGetFacadeClass(descriptor)
@@ -39,14 +39,7 @@ open class StubGeneratorExtensions {
open fun isStaticFunction(descriptor: FunctionDescriptor): Boolean = false
open fun deserializeLazyClass(
irClass: IrLazyClass,
stubGenerator: DeclarationStubGenerator,
parent: IrDeclarationParent,
allowErrorNodes: Boolean,
): Boolean = false
open fun deserializeFacadeClass(
open fun deserializeClass(
irClass: IrClass,
stubGenerator: DeclarationStubGenerator,
parent: IrDeclarationParent,