Pull down some implementation details from DeserializedPackageFragment
- DeserializedPackageFragmentImpl doesn't actually need member scope to be lazy in a sense of optimization. It was only necessary for breaking initialization cycle: DeserializationComponents <-> DeserializedPackageFragment - For MetadataPackageFragment it might be useful to have member scope actually lazy since it has O(n) complexity when n is a number of package parts This change is helpful for avoidance of storing reference to package-proto #KT-24513 In Progress
This commit is contained in:
+5
-2
@@ -46,8 +46,11 @@ class KotlinJavascriptPackageFragment(
|
||||
}
|
||||
}
|
||||
|
||||
private val annotationDeserializer: AnnotationDeserializer by storageManager.createLazyValue {
|
||||
AnnotationDeserializer(module, components.notFoundClasses)
|
||||
private lateinit var annotationDeserializer: AnnotationDeserializer
|
||||
|
||||
override fun initialize(components: DeserializationComponents) {
|
||||
super.initialize(components)
|
||||
this.annotationDeserializer = AnnotationDeserializer(components.moduleDescriptor, components.notFoundClasses)
|
||||
}
|
||||
|
||||
fun getContainingFileAnnotations(descriptor: DeclarationDescriptor): List<AnnotationDescriptor> {
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ fun createKotlinJavascriptPackageFragmentProvider(
|
||||
)
|
||||
|
||||
for (packageFragment in packageFragments.filterIsInstance<KotlinJavascriptPackageFragment>()) {
|
||||
packageFragment.components = components
|
||||
packageFragment.initialize(components)
|
||||
}
|
||||
|
||||
return provider
|
||||
|
||||
Reference in New Issue
Block a user