[kotlin compiler][update] 1.3.20-dev-1048

This commit is contained in:
Vasily Levchenko
2018-10-22 16:53:07 +03:00
parent 0015b608ac
commit 66bfd0ac4f
6 changed files with 34 additions and 24 deletions
@@ -307,12 +307,7 @@ internal class Context(config: KonanConfig) : KonanBackendContext(config) {
fun <T> getValue(member: LazyMember<T>): T =
@Suppress("UNCHECKED_CAST") (lazyValues.getOrPut(member, { member.initializer(this) }) as T)
@Deprecated("Use reflectionTypes0 instead.", ReplaceWith("this.reflectionTypes0"))
override val reflectionTypes: org.jetbrains.kotlin.backend.common.ReflectionTypes
get() = throw UnsupportedOperationException("This method will be removed soon")
// TODO: rename to reflectionTypes after updating the Kotlin compiler
val reflectionTypes0: KonanReflectionTypes by lazy(PUBLICATION) {
val reflectionTypes: KonanReflectionTypes by lazy(PUBLICATION) {
KonanReflectionTypes(moduleDescriptor, KonanFqNames.internalPackageName)
}
@@ -93,6 +93,13 @@ internal class KonanLower(val context: Context, val parentPhaser: PhaseManager)
phaser.phase(KonanPhase.LOWER_ENUMS) {
EnumClassLowering(context).run(irFile)
}
/**
* TODO: this is workaround for issue of unitialized parents in IrDeclaration,
* the last one detected in [EnumClassLowering]. The issue appears in [DefaultArgumentStubGenerator].
*/
irFile.patchDeclarationParents()
phaser.phase(KonanPhase.LOWER_INITIALIZERS) {
InitializersLowering(context).runOnFilePostfix(irFile)
}
@@ -105,6 +112,12 @@ internal class KonanLower(val context: Context, val parentPhaser: PhaseManager)
phaser.phase(KonanPhase.LOWER_CALLABLES) {
CallableReferenceLowering(context).lower(irFile)
}
/**
* TODO: this is workaround for issue of unitialized parents in IrDeclaration,
* the last one detected in [CallableReferenceLowering]. The issue appears in [LocalDeclarationsLowering].
*/
irFile.patchDeclarationParents()
phaser.phase(KonanPhase.LOWER_LOCAL_FUNCTIONS) {
LocalDeclarationsLowering(context).runOnFilePostfix(irFile)
}
@@ -36,7 +36,6 @@ import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import kotlin.properties.Delegates
@@ -426,23 +425,23 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable, val
val isInitializedPropertyDescriptor = builtInsPackage("kotlin")
.getContributedVariables(Name.identifier("isInitialized"), NoLookupLocation.FROM_BACKEND).single {
it.extensionReceiverParameter.let {
it != null && TypeUtils.getClassDescriptor(it.type) == context.reflectionTypes0.kProperty0
it != null && TypeUtils.getClassDescriptor(it.type) == context.reflectionTypes.kProperty0
} && !it.isExpect
}
val isInitializedGetterDescriptor = isInitializedPropertyDescriptor.getter!!
val kFunctionImpl = symbolTable.referenceClass(context.reflectionTypes0.kFunctionImpl)
val kFunctionImpl = symbolTable.referenceClass(context.reflectionTypes.kFunctionImpl)
val kProperty0Impl = symbolTable.referenceClass(context.reflectionTypes0.kProperty0Impl)
val kProperty1Impl = symbolTable.referenceClass(context.reflectionTypes0.kProperty1Impl)
val kProperty2Impl = symbolTable.referenceClass(context.reflectionTypes0.kProperty2Impl)
val kMutableProperty0Impl = symbolTable.referenceClass(context.reflectionTypes0.kMutableProperty0Impl)
val kMutableProperty1Impl = symbolTable.referenceClass(context.reflectionTypes0.kMutableProperty1Impl)
val kMutableProperty2Impl = symbolTable.referenceClass(context.reflectionTypes0.kMutableProperty2Impl)
val kProperty0Impl = symbolTable.referenceClass(context.reflectionTypes.kProperty0Impl)
val kProperty1Impl = symbolTable.referenceClass(context.reflectionTypes.kProperty1Impl)
val kProperty2Impl = symbolTable.referenceClass(context.reflectionTypes.kProperty2Impl)
val kMutableProperty0Impl = symbolTable.referenceClass(context.reflectionTypes.kMutableProperty0Impl)
val kMutableProperty1Impl = symbolTable.referenceClass(context.reflectionTypes.kMutableProperty1Impl)
val kMutableProperty2Impl = symbolTable.referenceClass(context.reflectionTypes.kMutableProperty2Impl)
val kLocalDelegatedPropertyImpl = symbolTable.referenceClass(context.reflectionTypes0.kLocalDelegatedPropertyImpl)
val kLocalDelegatedMutablePropertyImpl = symbolTable.referenceClass(context.reflectionTypes0.kLocalDelegatedMutablePropertyImpl)
val kLocalDelegatedPropertyImpl = symbolTable.referenceClass(context.reflectionTypes.kLocalDelegatedPropertyImpl)
val kLocalDelegatedMutablePropertyImpl = symbolTable.referenceClass(context.reflectionTypes.kLocalDelegatedMutablePropertyImpl)
val getClassTypeInfo = internalFunction("getClassTypeInfo")
val getObjectTypeInfo = internalFunction("getObjectTypeInfo")
@@ -483,7 +482,7 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable, val
.map { symbolTable.referenceClass(builtIns.getFunction(it)) }
val kFunctions = (0 .. KONAN_FUNCTION_INTERFACES_MAX_PARAMETERS)
.map { symbolTable.referenceClass(context.reflectionTypes0.getKFunction(it)) }
.map { symbolTable.referenceClass(context.reflectionTypes.getKFunction(it)) }
fun getKFunctionType(returnType: IrType, parameterTypes: List<IrType>): IrType {
val kFunctionClassSymbol = kFunctions[parameterTypes.size]
@@ -300,9 +300,9 @@ internal class PropertyDelegationLowering(val context: Context) : FileLoweringPa
val arguments = type.arguments
val expectedClassDescriptor = when (arguments.size) {
0 -> return false
1 -> context.reflectionTypes0.kMutableProperty0
2 -> context.reflectionTypes0.kMutableProperty1
3 -> context.reflectionTypes0.kMutableProperty2
1 -> context.reflectionTypes.kMutableProperty0
2 -> context.reflectionTypes.kMutableProperty1
3 -> context.reflectionTypes.kMutableProperty2
else -> throw AssertionError("More than 2 receivers is not allowed")
}
return type == expectedClassDescriptor.defaultType.replace(arguments)
+3
View File
@@ -15,6 +15,9 @@ buildscript {
maven {
url buildKotlinCompilerRepo
}
maven {
url kotlinCompilerRepo
}
}
dependencies {
+3 -3
View File
@@ -19,9 +19,9 @@ buildKotlinVersion=1.3.0-rc-116
buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_130_CompilerAllPlugins),number:1.3.0-rc-116,tag:kotlin-native,pinned:true/artifacts/content/maven
remoteRoot=konan_tests
testDataVersion=1226829:id
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_CompilerAllPlugins),number:1.3.20-dev-863,tag:kotlin-native,pinned:true/artifacts/content/maven
kotlinVersion=1.3.20-dev-863
testKotlinVersion=1.3.20-dev-1002
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_CompilerAllPlugins),number:1.3.20-dev-1048,tag:kotlin-native,pinned:true/artifacts/content/maven
kotlinVersion=1.3.20-dev-1048
testKotlinVersion=1.3.20-dev-1048
konanVersion=1.1.0
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
org.gradle.workers.max=4