Revert "[K/N] serialize field names to caches"
This reverts commit 1b521d564f.
This commit is contained in:
+3
-4
@@ -113,7 +113,7 @@ internal object InlineFunctionBodyReferenceSerializer {
|
|||||||
|
|
||||||
// [binaryType] is needed in case a field is of a private inline class type (which can't be deserialized).
|
// [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.
|
// 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) {
|
class SerializedClassFieldInfo(val name: Int, val binaryType: Int, val type: Int, val flags: Int, val alignment: Int) {
|
||||||
companion object {
|
companion object {
|
||||||
const val FLAG_IS_CONST = 1
|
const val FLAG_IS_CONST = 1
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,6 @@ internal object ClassFieldsSerializer {
|
|||||||
classFields.forEach {
|
classFields.forEach {
|
||||||
+it.file.fqName
|
+it.file.fqName
|
||||||
+it.file.path
|
+it.file.path
|
||||||
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 * 5) }
|
||||||
@@ -166,7 +165,7 @@ internal object ClassFieldsSerializer {
|
|||||||
stream.writeInt(it.outerThisIndex)
|
stream.writeInt(it.outerThisIndex)
|
||||||
stream.writeInt(it.fields.size)
|
stream.writeInt(it.fields.size)
|
||||||
it.fields.forEach { field ->
|
it.fields.forEach { field ->
|
||||||
stream.writeInt(stringTable.indices[field.name]!!)
|
stream.writeInt(field.name)
|
||||||
stream.writeInt(field.binaryType)
|
stream.writeInt(field.binaryType)
|
||||||
stream.writeInt(field.type)
|
stream.writeInt(field.type)
|
||||||
stream.writeInt(field.flags)
|
stream.writeInt(field.flags)
|
||||||
@@ -207,7 +206,7 @@ internal object ClassFieldsSerializer {
|
|||||||
val outerThisIndex = stream.readInt()
|
val outerThisIndex = stream.readInt()
|
||||||
val fieldsCount = stream.readInt()
|
val fieldsCount = stream.readInt()
|
||||||
val fields = Array(fieldsCount) {
|
val fields = Array(fieldsCount) {
|
||||||
val name = stringTable[stream.readInt()]
|
val name = stream.readInt()
|
||||||
val binaryType = stream.readInt()
|
val binaryType = stream.readInt()
|
||||||
val type = stream.readInt()
|
val type = stream.readInt()
|
||||||
val flags = stream.readInt()
|
val flags = stream.readInt()
|
||||||
|
|||||||
+3
-3
@@ -241,7 +241,7 @@ internal class KonanPartialModuleDeserializer(
|
|||||||
val nameAndType = BinaryNameAndType.decode(outerProtoClass.thisReceiver.nameType)
|
val nameAndType = BinaryNameAndType.decode(outerProtoClass.thisReceiver.nameType)
|
||||||
|
|
||||||
SerializedClassFieldInfo(
|
SerializedClassFieldInfo(
|
||||||
name = "",
|
name = INVALID_INDEX,
|
||||||
binaryType = INVALID_INDEX,
|
binaryType = INVALID_INDEX,
|
||||||
nameAndType.typeIndex,
|
nameAndType.typeIndex,
|
||||||
flags = 0,
|
flags = 0,
|
||||||
@@ -258,7 +258,7 @@ internal class KonanPartialModuleDeserializer(
|
|||||||
val primitiveBinaryType = field.type.computePrimitiveBinaryTypeOrNull()
|
val primitiveBinaryType = field.type.computePrimitiveBinaryTypeOrNull()
|
||||||
|
|
||||||
SerializedClassFieldInfo(
|
SerializedClassFieldInfo(
|
||||||
field.name,
|
nameAndType.nameIndex,
|
||||||
primitiveBinaryType?.ordinal ?: INVALID_INDEX,
|
primitiveBinaryType?.ordinal ?: INVALID_INDEX,
|
||||||
if (with(KonanManglerIr) { (classifier as? IrClassSymbol)?.owner?.isExported(compatibleMode) } == false)
|
if (with(KonanManglerIr) { (classifier as? IrClassSymbol)?.owner?.isExported(compatibleMode) } == false)
|
||||||
INVALID_INDEX
|
INVALID_INDEX
|
||||||
@@ -478,7 +478,7 @@ internal class KonanPartialModuleDeserializer(
|
|||||||
require(it.alignment == field.alignment) { "Mismatched align information for outer this" }
|
require(it.alignment == field.alignment) { "Mismatched align information for outer this" }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val name = field.name
|
val name = fileDeserializationState.fileReader.string(field.name)
|
||||||
val type = when {
|
val type = when {
|
||||||
field.type != INVALID_INDEX -> declarationDeserializer.deserializeIrType(field.type)
|
field.type != INVALID_INDEX -> declarationDeserializer.deserializeIrType(field.type)
|
||||||
field.binaryType == INVALID_INDEX -> builtIns.anyNType
|
field.binaryType == INVALID_INDEX -> builtIns.anyNType
|
||||||
|
|||||||
Reference in New Issue
Block a user