From c7963a86c1791f4817e9ae6c90d582d6b4dfd6f8 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Tue, 18 Apr 2017 03:12:07 +0300 Subject: [PATCH] Start a new serializer for each class. The consequence of that would be the type tables started anew for each class. Without that the ever growing common global type table is written to each class. Making the class protobufs bigger and bigger. --- .../backend/konan/serialization/KonanSerializationUtil.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanSerializationUtil.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanSerializationUtil.kt index 0ddb7fbcd48..c07dbe740af 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanSerializationUtil.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanSerializationUtil.kt @@ -160,11 +160,12 @@ internal class KonanSerializationUtil(val context: Context) { if (skip(classDescriptor)) return - val classProto = serializer.classProto(classDescriptor).build() + val localSerializer = KonanDescriptorSerializer.create(classDescriptor, serializerExtension) + val classProto = localSerializer.classProto(classDescriptor).build() ?: error("Class not serialized: $classDescriptor") builder.addClasses(classProto) - val index = serializer.stringTable.getFqNameIndex(classDescriptor) + val index = localSerializer.stringTable.getFqNameIndex(classDescriptor) builder.addClassName(index) serializeClasses(packageName, builder,