[FIR] optimize direct allocation of empty ConeTypeProjection arrays
On the snapshot from KTIJ-26260 empty ConeTypeProjection arrays take about 10mb
This commit is contained in:
committed by
Space Team
parent
04d330edae
commit
bdfc68468f
@@ -217,7 +217,7 @@ private fun JavaClassifierType.toConeKotlinTypeForFlexibleBound(
|
||||
else -> lowerBound?.typeArguments
|
||||
}
|
||||
|
||||
lookupTag.constructClassType(mappedTypeArguments ?: emptyArray(), isNullable = lowerBound != null, attributes)
|
||||
lookupTag.constructClassType(mappedTypeArguments ?: ConeTypeProjection.EMPTY_ARRAY, isNullable = lowerBound != null, attributes)
|
||||
}
|
||||
|
||||
is JavaTypeParameter -> {
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.FirRegularClassBuilder
|
||||
import org.jetbrains.kotlin.fir.deserialization.FirConstDeserializer
|
||||
import org.jetbrains.kotlin.fir.deserialization.FirDeserializationExtension
|
||||
import org.jetbrains.kotlin.fir.types.ConeTypeProjection
|
||||
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.fir.types.toLookupTag
|
||||
@@ -43,7 +44,7 @@ class FirJvmDeserializationExtension(session: FirSession) : FirDeserializationEx
|
||||
superTypeRefs += buildResolvedTypeRef {
|
||||
type = ConeClassLikeTypeImpl(
|
||||
JAVA_IO_SERIALIZABLE.toLookupTag(),
|
||||
typeArguments = emptyArray(),
|
||||
typeArguments = ConeTypeProjection.EMPTY_ARRAY,
|
||||
isNullable = false
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user