diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt index d8b289cdc6f..cb628860134 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt @@ -155,7 +155,8 @@ internal val sharedVariablesPhase = makeKonanFileLoweringPhase( internal val localFunctionsPhase = makeKonanFileOpPhase( op = { context, irFile -> LocalDelegatedPropertiesLowering().lower(irFile) - LocalDeclarationsLowering(context).runOnFilePostfix(irFile) + LocalDeclarationsLowering(context).lower(irFile) + LocalClassPopupLowering(context).lower(irFile) }, name = "LocalFunctions", description = "Local function lowering", diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt index 69f87aaf5e8..4c34b76c89e 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/Ir.kt @@ -328,7 +328,9 @@ internal class KonanSymbols(context: Context, private val symbolTable: SymbolTab override val getContinuation = internalFunction("getContinuation") - val returnIfSuspended = internalFunction("returnIfSuspended") + override val returnIfSuspended = internalFunction("returnIfSuspended") + + val coroutineLaunchpad = internalFunction("coroutineLaunchpad") @@ -336,6 +338,8 @@ internal class KonanSymbols(context: Context, private val symbolTable: SymbolTab val konanCoroutineContextGetter = internalFunction("getCoroutineContext") + override val suspendCoroutineUninterceptedOrReturn = konanSuspendCoroutineUninterceptedOrReturn + private val coroutinesIntrinsicsPackage = context.builtIns.builtInsModule.getPackage( context.config.configuration.languageVersionSettings.coroutinesIntrinsicsPackageFqName()).memberScope @@ -345,11 +349,14 @@ internal class KonanSymbols(context: Context, private val symbolTable: SymbolTab val continuationClassDescriptor = coroutinesPackage .getContributedClassifier(Name.identifier("Continuation"), NoLookupLocation.FROM_BACKEND) as ClassDescriptor - val coroutineContextGetter = coroutinesPackage + private val coroutineContextGetterDescriptor = coroutinesPackage .getContributedVariables(Name.identifier("coroutineContext"), NoLookupLocation.FROM_BACKEND) .single() .getter!! + override val coroutineContextGetter = symbolTable.referenceSimpleFunction(coroutineContextGetterDescriptor) + override val coroutineGetContext = coroutineContextGetter + override val coroutineImpl get() = TODO() val baseContinuationImpl = topLevelClass("kotlin.coroutines.native.internal.BaseContinuationImpl") diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index 682d58c2e5f..762d9705644 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -11,8 +11,10 @@ import org.jetbrains.kotlin.backend.common.descriptors.allParameters import org.jetbrains.kotlin.backend.common.ir.ir2string import org.jetbrains.kotlin.backend.konan.* import org.jetbrains.kotlin.backend.konan.descriptors.* +import org.jetbrains.kotlin.backend.konan.descriptors.isArray import org.jetbrains.kotlin.backend.konan.ir.* import org.jetbrains.kotlin.backend.konan.ir.NaiveSourceBasedFileEntryImpl +import org.jetbrains.kotlin.backend.konan.ir.containsNull import org.jetbrains.kotlin.backend.konan.llvm.coverage.* import org.jetbrains.kotlin.backend.konan.llvm.objcexport.is64Bit import org.jetbrains.kotlin.backend.konan.optimizations.* @@ -1237,6 +1239,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map evaluateInstanceOf(value) IrTypeOperator.NOT_INSTANCEOF -> evaluateNotInstanceOf(value) IrTypeOperator.SAM_CONVERSION -> TODO(ir2string(value)) + IrTypeOperator.IMPLICIT_DYNAMIC_CAST -> TODO(ir2string(value)) } } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt index 3c241247281..11a91c8f716 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt @@ -74,7 +74,7 @@ internal class FunctionInlining(val context: Context) : IrElementTransformerVoid descriptor.isBuiltInSuspendCoroutineUninterceptedOrReturn(languageVersionSettings) -> context.ir.symbols.konanSuspendCoroutineUninterceptedOrReturn.owner - descriptor == context.ir.symbols.coroutineContextGetter -> + symbol == context.ir.symbols.coroutineContextGetter -> context.ir.symbols.konanCoroutineContextGetter.owner else -> (symbol.owner as? IrSimpleFunction)?.resolveFakeOverride() ?: symbol.owner diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt index a046b61e308..d4de8f4614a 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.backend.konan.descriptors.isInterface import org.jetbrains.kotlin.backend.konan.descriptors.synthesizedName import org.jetbrains.kotlin.backend.konan.ir.* import org.jetbrains.kotlin.backend.konan.ir.companionObject +import org.jetbrains.kotlin.backend.konan.ir.containsNull import org.jetbrains.kotlin.backend.konan.llvm.IntrinsicType import org.jetbrains.kotlin.backend.konan.llvm.llvmSymbolOrigin import org.jetbrains.kotlin.backend.konan.llvm.tryGetIntrinsicType diff --git a/gradle.properties b/gradle.properties index 5ab581f60dc..275b1e5a609 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,10 +18,10 @@ 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-1455,branch:default:any,pinned:true/artifacts/content/maven -kotlinVersion=1.3.50-dev-1455 -kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1455,branch:default:any,pinned:true/artifacts/content/maven -kotlinStdlibVersion=1.3.50-dev-1455 +kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1741,branch:default:any,pinned:true/artifacts/content/maven +kotlinVersion=1.3.50-dev-1741 +kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1741,branch:default:any,pinned:true/artifacts/content/maven +kotlinStdlibVersion=1.3.50-dev-1741 testKotlinCompilerVersion=1.3.50-dev-1455 konanVersion=1.3.50 org.gradle.jvmargs='-Dfile.encoding=UTF-8'