From d8994435d630773c4cb99fb9baaa8095b94b4f3e Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Thu, 20 Jun 2019 16:30:07 +0300 Subject: [PATCH] [kotlin compiler][update] 1.3.50-dev-1390 --- .../KonanDeserializeDescriptorReference.kt | 81 ------------------- .../backend/konan/serialization/UniqId.kt | 1 + gradle.properties | 10 +-- 3 files changed, 6 insertions(+), 86 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanDeserializeDescriptorReference.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanDeserializeDescriptorReference.kt index eb5ac6d2fec..e4deb704e88 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanDeserializeDescriptorReference.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanDeserializeDescriptorReference.kt @@ -27,85 +27,4 @@ class KonanDescriptorReferenceDeserializer( override fun resolveSpecialDescriptor(fqn: FqName): DeclarationDescriptor = currentModule override fun checkIfSpecialDescriptorId(id: Long): Boolean = false override fun getDescriptorIdOrNull(descriptor: DeclarationDescriptor): Long? = null - - // Most of this function duplicates the parent, but it deals with forward declarations. - // TODO: Refactor me. - override fun deserializeDescriptorReference( - packageFqNameString: String, - classFqNameString: String, - name: String, - index: Long?, - isEnumEntry: Boolean, - isEnumSpecial: Boolean, - isDefaultConstructor: Boolean, - isFakeOverride: Boolean, - isGetter: Boolean, - isSetter: Boolean, - isTypeParameter: Boolean - ): DeclarationDescriptor { - val packageFqName = packageFqNameString.let { - if (it == "") FqName.ROOT else FqName(it) - }// TODO: whould we store an empty string in the protobuf? - - val classFqName = FqName(classFqNameString) - val protoIndex = index - - val (clazz, members) = if (classFqNameString == "") { - Pair(null, getContributedDescriptors(packageFqNameString, name)) - } else { - val clazz = currentModule.findClassAcrossModuleDependencies(ClassId(packageFqName, classFqName, false))!! - Pair(clazz, clazz.unsubstitutedMemberScope.getContributedDescriptors() + clazz.getConstructors()) - } - - if (packageFqNameString.startsWith("cnames.") || packageFqNameString.startsWith("objcnames.")) { - val descriptor = - currentModule.findClassAcrossModuleDependencies(ClassId(packageFqName, FqName(name), false))!! - if (!descriptor.fqNameUnsafe.asString().startsWith("cnames") && !descriptor.fqNameUnsafe.asString().startsWith( - "objcnames" - ) - ) { - if (descriptor is DeserializedClassDescriptor) { - val uniqId = UniqId(descriptor.getUniqId()!!, false) - val newKey = UniqIdKey(null, uniqId) - val oldKey = UniqIdKey(null, UniqId(protoIndex!!, false)) - - resolvedForwardDeclarations.put(oldKey, newKey) - } else { - /* ??? */ - } - } - return descriptor - } - - if (isEnumEntry) { - val memberScope = (clazz as DeserializedClassDescriptor).getUnsubstitutedMemberScope() - return memberScope.getContributedClassifier(Name.identifier(name), NoLookupLocation.FROM_BACKEND)!! - } - - if (isEnumSpecial) { - return clazz!!.getStaticScope() - .getContributedFunctions(Name.identifier(name), NoLookupLocation.FROM_BACKEND).single() - } - - if (isTypeParameter) { - return clazz!!.declaredTypeParameters.first { it.name.asString() == name } - } - - val membersWithIndices = getMembers(members) - - return when { - isDefaultConstructor -> membersWithIndices.defaultConstructor - - else -> { - val map = if (isFakeOverride) membersWithIndices.realMembers else membersWithIndices.members - map[protoIndex]?.let { member -> - when { - member is PropertyDescriptor && isSetter -> member.setter!! - member is PropertyDescriptor && isGetter -> member.getter!! - else -> member - } - } - } - } ?: error("Could not find serialized descriptor for index: ${index} ${packageFqName},${classFqName},${name}") - } } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/UniqId.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/UniqId.kt index a23c209400b..745b34347da 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/UniqId.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/UniqId.kt @@ -18,6 +18,7 @@ object KonanDescriptorUniqIdAware: DescriptorUniqIdAware { is DeserializedSimpleFunctionDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.functionUniqId) is DeserializedPropertyDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.propertyUniqId) is DeserializedClassConstructorDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.constructorUniqId) + is DeserializedTypeParameterDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.typeParamUniqId) else -> null }?.index } diff --git a/gradle.properties b/gradle.properties index aabd2653c6f..0ccd2f517e5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,11 +18,11 @@ buildKotlinVersion=1.3.50-dev-787 buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-787,branch:default:any,pinned:true/artifacts/content/maven remoteRoot=konan_tests -kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1062,branch:default:any,pinned:true/artifacts/content/maven -kotlinVersion=1.3.50-dev-1062 -kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1340,branch:default:any,pinned:true/artifacts/content/maven -kotlinStdlibVersion=1.3.50-dev-1340 -testKotlinCompilerVersion=1.3.50-dev-630 +kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1390,branch:default:any,pinned:true/artifacts/content/maven +kotlinVersion=1.3.50-dev-1390 +kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1390,branch:default:any,pinned:true/artifacts/content/maven +kotlinStdlibVersion=1.3.50-dev-1390 +testKotlinCompilerVersion=1.3.50-dev-1390 konanVersion=1.3.50 org.gradle.jvmargs='-Dfile.encoding=UTF-8' org.gradle.workers.max=4