Avoid serlialization for unrelated Java source-based classes

There is no need to track unknown (not being tracked before)
classes content of which we didn't request

 #KT-17621 Fixed
This commit is contained in:
Denis Zharkov
2017-11-29 12:26:26 +03:00
parent f33255c990
commit 8dd5c2f895
4 changed files with 24 additions and 1 deletions
@@ -156,6 +156,11 @@ class LazyJavaClassDescriptor(
}
}
// Checks if any part of compiler has requested scope content
// It's necessary for IC to figure out if there is a need to track symbols in the class
fun wasScopeContentRequested() =
getUnsubstitutedMemberScope().wasContentRequested() || staticScope.wasContentRequested()
override fun getSealedSubclasses(): Collection<ClassDescriptor> = emptyList()
override fun toString() = "Lazy Java class ${this.fqNameUnsafe}"
@@ -67,6 +67,8 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS
protected val declaredMemberIndex: NotNullLazyValue<DeclaredMemberIndex> = c.storageManager.createLazyValue { computeMemberIndex() }
fun wasContentRequested() = declaredMemberIndex.isComputed()
protected abstract fun computeMemberIndex(): DeclaredMemberIndex
// Fake overrides, values()/valueOf(), etc.