[K/N] remove class field types from caches
^KT-65443
This commit is contained in:
+5
-8
@@ -110,10 +110,9 @@ internal object InlineFunctionBodyReferenceSerializer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [binaryType] is needed in case a field is of a private inline class type (which can't be deserialized).
|
||||
// But it is safe to just set the field's type to the primitive type the inline class will be erased to.
|
||||
class SerializedClassFieldInfo(val name: String, val binaryType: Int, val type: Int, val flags: Int, val alignment: Int) {
|
||||
// [binaryType] is needed in case a field is of a primitive type. Otherwise we know it's an object type and
|
||||
// that is enough information for the backend.
|
||||
class SerializedClassFieldInfo(val name: String, val binaryType: Int, val flags: Int, val alignment: Int) {
|
||||
companion object {
|
||||
const val FLAG_IS_CONST = 1
|
||||
}
|
||||
@@ -155,7 +154,7 @@ internal object ClassFieldsSerializer {
|
||||
it.fields.forEach { +it.name }
|
||||
}
|
||||
}
|
||||
val size = stringTable.sizeBytes + classFields.sumOf { Int.SIZE_BYTES * (6 + it.typeParameterSigs.size + it.fields.size * 5) }
|
||||
val size = stringTable.sizeBytes + classFields.sumOf { Int.SIZE_BYTES * (6 + it.typeParameterSigs.size + it.fields.size * 4) }
|
||||
val stream = ByteArrayStream(ByteArray(size))
|
||||
stringTable.serialize(stream)
|
||||
classFields.forEach {
|
||||
@@ -168,7 +167,6 @@ internal object ClassFieldsSerializer {
|
||||
it.fields.forEach { field ->
|
||||
stream.writeInt(stringTable.indices[field.name]!!)
|
||||
stream.writeInt(field.binaryType)
|
||||
stream.writeInt(field.type)
|
||||
stream.writeInt(field.flags)
|
||||
stream.writeInt(field.alignment)
|
||||
}
|
||||
@@ -209,10 +207,9 @@ internal object ClassFieldsSerializer {
|
||||
val fields = Array(fieldsCount) {
|
||||
val name = stringTable[stream.readInt()]
|
||||
val binaryType = stream.readInt()
|
||||
val type = stream.readInt()
|
||||
val flags = stream.readInt()
|
||||
val alignment = stream.readInt()
|
||||
SerializedClassFieldInfo(name, binaryType, type, flags, alignment)
|
||||
SerializedClassFieldInfo(name, binaryType, flags, alignment)
|
||||
}
|
||||
val fileSignature = IdSignature.FileSignature(
|
||||
id = Any(),
|
||||
|
||||
-5
@@ -243,7 +243,6 @@ internal class KonanPartialModuleDeserializer(
|
||||
SerializedClassFieldInfo(
|
||||
name = "",
|
||||
binaryType = INVALID_INDEX,
|
||||
nameAndType.typeIndex,
|
||||
flags = 0,
|
||||
field.alignment
|
||||
)
|
||||
@@ -260,9 +259,6 @@ internal class KonanPartialModuleDeserializer(
|
||||
SerializedClassFieldInfo(
|
||||
field.name,
|
||||
primitiveBinaryType?.ordinal ?: INVALID_INDEX,
|
||||
if (with(KonanManglerIr) { (classifier as? IrClassSymbol)?.owner?.isExported(compatibleMode) } == false)
|
||||
INVALID_INDEX
|
||||
else nameAndType.typeIndex,
|
||||
flags,
|
||||
field.alignment
|
||||
)
|
||||
@@ -480,7 +476,6 @@ internal class KonanPartialModuleDeserializer(
|
||||
} else {
|
||||
val name = field.name
|
||||
val type = when {
|
||||
field.type != INVALID_INDEX -> declarationDeserializer.deserializeIrType(field.type)
|
||||
field.binaryType == INVALID_INDEX -> builtIns.anyNType
|
||||
else -> when (PrimitiveBinaryType.values().getOrNull(field.binaryType)) {
|
||||
PrimitiveBinaryType.BOOLEAN -> builtIns.booleanType
|
||||
|
||||
Reference in New Issue
Block a user