diff --git a/Interop/JsRuntime/src/main/kotlin/jsinterop.kt b/Interop/JsRuntime/src/main/kotlin/jsinterop.kt index 94f28bb2e09..e330f75a79d 100644 --- a/Interop/JsRuntime/src/main/kotlin/jsinterop.kt +++ b/Interop/JsRuntime/src/main/kotlin/jsinterop.kt @@ -15,8 +15,8 @@ */ package kotlinx.wasm.jsinterop - -import konan.internal.ExportForCppRuntime +import kotlin.native.* +import kotlin.native.internal.ExportForCppRuntime import kotlinx.cinterop.* typealias Arena = Int diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/FunctionPointers.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/FunctionPointers.kt index c30153e7ba6..4e4dd0a3f43 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/FunctionPointers.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/FunctionPointers.kt @@ -16,8 +16,8 @@ package kotlinx.cinterop -import konan.internal.Intrinsic -import konan.internal.ExportForCompiler +import kotlin.native.internal.Intrinsic +import kotlin.native.internal.ExportForCompiler @Intrinsic external operator fun CPointer R>>.invoke(): R diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeMem.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeMem.kt index ef2a725d2a8..cfc8f351ccd 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeMem.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeMem.kt @@ -16,7 +16,8 @@ package kotlinx.cinterop -import konan.internal.Intrinsic +import kotlin.native.* +import kotlin.native.internal.Intrinsic @PublishedApi internal inline val pointerSize: Int diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeStableRef.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeStableRef.kt index bc38cc54535..872427ebd41 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeStableRef.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeStableRef.kt @@ -15,6 +15,7 @@ */ package kotlinx.cinterop +import kotlin.native.* @SymbolName("Kotlin_Interop_createStablePointer") internal external fun createStablePointer(any: Any): COpaquePointer diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeTypes.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeTypes.kt index 51a8578bb33..831fe753d5c 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeTypes.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeTypes.kt @@ -16,12 +16,12 @@ package kotlinx.cinterop -import konan.internal.getNativeNullPtr -import konan.internal.Intrinsic -import konan.internal.reinterpret +import kotlin.native.internal.getNativeNullPtr +import kotlin.native.internal.Intrinsic +import kotlin.native.internal.reinterpret -typealias NativePtr = konan.internal.NativePtr -internal typealias NonNullNativePtr = konan.internal.NonNullNativePtr +typealias NativePtr = kotlin.native.internal.NativePtr +internal typealias NonNullNativePtr = kotlin.native.internal.NonNullNativePtr @Suppress("NOTHING_TO_INLINE") internal inline fun NativePtr.toNonNull() = this.reinterpret() diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeUtils.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeUtils.kt index 8637f459dc0..31b1246e371 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeUtils.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/NativeUtils.kt @@ -16,7 +16,7 @@ package kotlinx.cinterop -import konan.internal.Intrinsic +import kotlin.native.internal.Intrinsic internal fun decodeFromUtf8(bytes: ByteArray): String = bytes.stringFromUtf8() diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/ObjectiveCImpl.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/ObjectiveCImpl.kt index 9bc04d0634c..2fa9b25435d 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/ObjectiveCImpl.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/ObjectiveCImpl.kt @@ -17,6 +17,7 @@ @file:Suppress("NOTHING_TO_INLINE") package kotlinx.cinterop +import kotlin.native.* interface ObjCObject interface ObjCClass : ObjCObject @@ -24,7 +25,7 @@ interface ObjCClassOf : ObjCClass // TODO: T should be added to typealias ObjCObjectMeta = ObjCClass @ExportTypeInfo("theForeignObjCObjectTypeInfo") -internal open class ForeignObjCObject : konan.internal.ObjCObjectWrapper +internal open class ForeignObjCObject : kotlin.native.internal.ObjCObjectWrapper abstract class ObjCObjectBase protected constructor() : ObjCObject { @Target(AnnotationTarget.CONSTRUCTOR) @@ -39,10 +40,10 @@ fun optional(): Nothing = throw RuntimeException("Do not call me!!!") "Add @OverrideInit to constructor to make it override Objective-C initializer", level = DeprecationLevel.WARNING ) -@konan.internal.Intrinsic +@kotlin.native.internal.Intrinsic external fun T.initBy(constructorCall: T): T -@konan.internal.ExportForCompiler +@kotlin.native.internal.ExportForCompiler private fun ObjCObjectBase.superInitCheck(superInitCallResult: ObjCObject?) { if (superInitCallResult == null) throw RuntimeException("Super initialization failed") @@ -88,7 +89,7 @@ var ObjCNotImplementedVar.value: T typealias ObjCStringVarOf = ObjCNotImplementedVar typealias ObjCBlockVar = ObjCNotImplementedVar -@konan.internal.Intrinsic external fun getReceiverOrSuper(receiver: NativePtr, superClass: NativePtr): COpaquePointer? +@kotlin.native.internal.Intrinsic external fun getReceiverOrSuper(receiver: NativePtr, superClass: NativePtr): COpaquePointer? @Target(AnnotationTarget.CLASS) @Retention(AnnotationRetention.BINARY) @@ -118,7 +119,7 @@ annotation class InteropStubs() @Retention(AnnotationRetention.SOURCE) private annotation class ObjCMethodImp(val selector: String, val encoding: String) -@konan.internal.ExportForCppRuntime("Kotlin_Interop_getObjCClass") +@kotlin.native.internal.ExportForCppRuntime("Kotlin_Interop_getObjCClass") private fun getObjCClassByName(name: NativePtr): NativePtr { val result = objc_lookUpClass(name) if (result == nativeNullPtr) { @@ -131,7 +132,7 @@ private fun getObjCClassByName(name: NativePtr): NativePtr { return result } -@konan.internal.ExportForCompiler +@kotlin.native.internal.ExportForCompiler private fun allocObjCObject(clazz: NativePtr): NativePtr { val rawResult = objc_allocWithZone(clazz) if (rawResult == nativeNullPtr) { @@ -143,14 +144,15 @@ private fun allocObjCObject(clazz: NativePtr): NativePtr { return rawResult } -@konan.internal.Intrinsic -@konan.internal.ExportForCompiler +@kotlin.native.internal.Intrinsic +@kotlin.native.internal.ExportForCompiler private external fun getObjCClass(): NativePtr -@konan.internal.Intrinsic external fun getMessenger(superClass: NativePtr): COpaquePointer? -@konan.internal.Intrinsic external fun getMessengerStret(superClass: NativePtr): COpaquePointer? +@kotlin.native.internal.Intrinsic external fun getMessenger(superClass: NativePtr): COpaquePointer? +@kotlin.native.internal.Intrinsic external fun getMessengerStret(superClass: NativePtr): COpaquePointer? -internal class ObjCWeakReferenceImpl : konan.ref.WeakReferenceImpl() { + +internal class ObjCWeakReferenceImpl : kotlin.native.ref.WeakReferenceImpl() { @SymbolName("Konan_ObjCInterop_getWeakReference") external override fun get(): Any? } @@ -158,7 +160,7 @@ internal class ObjCWeakReferenceImpl : konan.ref.WeakReferenceImpl() { @SymbolName("Konan_ObjCInterop_initWeakReference") private external fun ObjCWeakReferenceImpl.init(objcPtr: NativePtr) -@konan.internal.ExportForCppRuntime internal fun makeObjCWeakReferenceImpl(objcPtr: NativePtr): ObjCWeakReferenceImpl { +@kotlin.native.internal.ExportForCppRuntime internal fun makeObjCWeakReferenceImpl(objcPtr: NativePtr): ObjCWeakReferenceImpl { val result = ObjCWeakReferenceImpl() result.init(objcPtr) return result diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Pinning.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Pinning.kt index 05e40ece05b..ac184f33fe2 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Pinning.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Pinning.kt @@ -15,6 +15,7 @@ */ package kotlinx.cinterop +import kotlin.native.* data class Pinned internal constructor(private val stablePtr: COpaquePointer) { diff --git a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Varargs.kt b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Varargs.kt index 227b2bb23fa..bbe60645858 100644 --- a/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Varargs.kt +++ b/Interop/Runtime/src/native/kotlin/kotlinx/cinterop/Varargs.kt @@ -15,6 +15,7 @@ */ package kotlinx.cinterop +import kotlin.native.* private const val MAX_ARGUMENT_SIZE = 8 diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/ObjCStubs.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/ObjCStubs.kt index 6f4a121c4e4..cf48de819e7 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/ObjCStubs.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/ObjCStubs.kt @@ -121,7 +121,7 @@ class ObjCMethodStub(private val stubGenerator: StubGenerator, } context.addTopLevelDeclaration( - listOf("@konan.internal.ExportForCompiler", + listOf("@kotlin.native.internal.ExportForCompiler", "@ObjCBridge".applyToStrings(method.selector, method.encoding, implementationTemplate)) + block(bridgeHeader, bodyLines) ) diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/SimpleBridgeGeneratorImpl.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/SimpleBridgeGeneratorImpl.kt index 701a71cccbd..5bf772db786 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/SimpleBridgeGeneratorImpl.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/SimpleBridgeGeneratorImpl.kt @@ -168,7 +168,7 @@ class SimpleBridgeGeneratorImpl( val cReturnType = returnType.nativeType val symbolName = pkgName.replace(INVALID_CLANG_IDENTIFIER_REGEX, "_") + "_$kotlinFunctionName" - kotlinLines.add("@konan.internal.ExportForCppRuntime(${symbolName.quoteAsKotlinLiteral()})") + kotlinLines.add("@kotlin.native.internal.ExportForCppRuntime(${symbolName.quoteAsKotlinLiteral()})") val cFunctionHeader = "$cReturnType $symbolName($joinedCParameters)" nativeLines.add("$cFunctionHeader;") diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt index f1b0f5412d9..12549b72168 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt @@ -903,7 +903,7 @@ class StubGenerator( out("") } if (platform == KotlinPlatform.NATIVE) { - out("import konan.SymbolName") + out("import kotlin.native.SymbolName") } out("import kotlinx.cinterop.*") diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt index 2cf36e04f3c..54e625430f8 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt @@ -111,7 +111,7 @@ private val cKeywords = setOf( "xor_eq" ) -private val cnameAnnotation = FqName("konan.internal.CName") +private val cnameAnnotation = FqName("kotlin.native.internal.CName") private fun org.jetbrains.kotlin.types.KotlinType.isGeneric() = constructor.declarationDescriptor is TypeParameterDescriptor diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Context.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Context.kt index 6a2b59be479..c564a68047e 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Context.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Context.kt @@ -285,14 +285,14 @@ internal class Context(config: KonanConfig) : KonanBackendContext(config) { moduleDescriptor.builtIns as KonanBuiltIns } - private val packageScope by lazy { builtIns.builtInsModule.getPackage(KonanFqNames.packageName).memberScope } + private val packageScope by lazy { builtIns.builtInsModule.getPackage(KonanFqNames.internalPackageName).memberScope } val nativePtr by lazy { packageScope.getContributedClassifier(NATIVE_PTR_NAME) as ClassDescriptor } val nativePtrPlusLong by lazy { nativePtr.unsubstitutedMemberScope.getContributedFunctions("plus").single() } val nativePtrToLong by lazy { nativePtr.unsubstitutedMemberScope.getContributedFunctions("toLong").single() } val getNativeNullPtr by lazy { packageScope.getContributedFunctions("getNativeNullPtr").single() } val immutableBinaryBlobOf by lazy { - builtIns.builtInsModule.getPackage(FqName("konan")).memberScope.getContributedFunctions("immutableBinaryBlobOf").single() + builtIns.builtInsModule.getPackage(KonanFqNames.packageName).memberScope.getContributedFunctions("immutableBinaryBlobOf").single() } val specialDeclarationsFactory = SpecialDeclarationsFactory(this) @@ -319,7 +319,7 @@ internal class Context(config: KonanConfig) : KonanBackendContext(config) { @Suppress("UNCHECKED_CAST") (lazyValues.getOrPut(member, { member.initializer(this) }) as T) override val reflectionTypes: ReflectionTypes by lazy(PUBLICATION) { - ReflectionTypes(moduleDescriptor, FqName("konan.internal")) + ReflectionTypes(moduleDescriptor, KonanFqNames.internalPackageName) } private val vtableBuilders = mutableMapOf() diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InlineClasses.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InlineClasses.kt index 0f74065a1e5..1a0e6060ac7 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InlineClasses.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InlineClasses.kt @@ -212,14 +212,14 @@ private val implicitInlineClasses = private enum class ValueClass(val fqName: FqNameUnsafe, val binaryType: BinaryType.Primitive) { - BOOLEAN("konan.internal.BooleanValue", PrimitiveBinaryType.BOOLEAN), - BYTE("konan.internal.ByteValue", PrimitiveBinaryType.BYTE), - SHORT("konan.internal.ShortValue", PrimitiveBinaryType.SHORT), - INT("konan.internal.IntValue", PrimitiveBinaryType.INT), - LONG("konan.internal.LongValue", PrimitiveBinaryType.LONG), - FLOAT("konan.internal.FloatValue", PrimitiveBinaryType.FLOAT), - DOUBLE("konan.internal.DoubleValue", PrimitiveBinaryType.DOUBLE), - NON_NULL_POINTER("konan.internal.NotNullPointerValue", PrimitiveBinaryType.POINTER) + BOOLEAN("kotlin.native.internal.BooleanValue", PrimitiveBinaryType.BOOLEAN), + BYTE("kotlin.native.internal.ByteValue", PrimitiveBinaryType.BYTE), + SHORT("kotlin.native.internal.ShortValue", PrimitiveBinaryType.SHORT), + INT("kotlin.native.internal.IntValue", PrimitiveBinaryType.INT), + LONG("kotlin.native.internal.LongValue", PrimitiveBinaryType.LONG), + FLOAT("kotlin.native.internal.FloatValue", PrimitiveBinaryType.FLOAT), + DOUBLE("kotlin.native.internal.DoubleValue", PrimitiveBinaryType.DOUBLE), + NON_NULL_POINTER("kotlin.native.internal.NotNullPointerValue", PrimitiveBinaryType.POINTER) ; diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InteropUtils.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InteropUtils.kt index 48ff03caab1..dd01cced683 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InteropUtils.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InteropUtils.kt @@ -104,7 +104,7 @@ internal class InteropBuiltIns(builtIns: KonanBuiltIns, vararg konanPrimitives: val staticCFunction = packageScope.getContributedFunctions("staticCFunction").toSet() - val workerPackageScope = builtIns.builtInsModule.getPackage(FqName("konan.worker")).memberScope + val workerPackageScope = builtIns.builtInsModule.getPackage(FqName("kotlin.native.worker")).memberScope val scheduleFunction = workerPackageScope.getContributedClass("Worker") .unsubstitutedMemberScope.getContributedFunctions("schedule").single() diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanBackendContext.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanBackendContext.kt index e5c90a653db..d1fcea922d3 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanBackendContext.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanBackendContext.kt @@ -18,7 +18,7 @@ package org.jetbrains.kotlin.backend.konan import org.jetbrains.kotlin.backend.common.CommonBackendContext import org.jetbrains.kotlin.backend.konan.descriptors.KonanSharedVariablesManager -import org.jetbrains.kotlin.backend.konan.descriptors.konanInternal +import org.jetbrains.kotlin.backend.konan.descriptors.kotlinNativeInternal import org.jetbrains.kotlin.backend.konan.ir.KonanIr import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation @@ -44,10 +44,10 @@ abstract internal class KonanBackendContext(val config: KonanConfig) : CommonBac } override fun getInternalClass(name: String): ClassDescriptor = - builtIns.konanInternal.getContributedClassifier(Name.identifier(name), NoLookupLocation.FROM_BACKEND) as ClassDescriptor + builtIns.kotlinNativeInternal.getContributedClassifier(Name.identifier(name), NoLookupLocation.FROM_BACKEND) as ClassDescriptor override fun getInternalFunctions(name: String): List = - builtIns.konanInternal.getContributedFunctions(Name.identifier(name), NoLookupLocation.FROM_BACKEND).toList() + builtIns.kotlinNativeInternal.getContributedFunctions(Name.identifier(name), NoLookupLocation.FROM_BACKEND).toList() val messageCollector: MessageCollector get() = config.configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanFqNames.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanFqNames.kt index fe1dfd3fa03..fd78dbff93c 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanFqNames.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanFqNames.kt @@ -24,10 +24,11 @@ internal const val NATIVE_PTR_NAME = "NativePtr" object KonanFqNames { - val packageName = FqName("konan.internal") - val nativePtr = packageName.child(Name.identifier(NATIVE_PTR_NAME)).toUnsafe() - val nonNullNativePtr = FqNameUnsafe("konan.internal.NonNullNativePtr") - val throws = FqName("konan.Throws") + val packageName = FqName("kotlin.native") + val internalPackageName = FqName("kotlin.native.internal") + val nativePtr = internalPackageName.child(Name.identifier(NATIVE_PTR_NAME)).toUnsafe() + val nonNullNativePtr = FqNameUnsafe("kotlin.native.internal.NonNullNativePtr") + val throws = FqName("kotlin.native.Throws") } /** diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt index eead21ffdc4..59121f1cd4b 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt @@ -83,8 +83,8 @@ internal fun IrSimpleFunction.resolveFakeOverride(): IrSimpleFunction { return realSupers.first { it.modality != Modality.ABSTRACT } } -private val intrinsicAnnotation = FqName("konan.internal.Intrinsic") -private val frozenAnnotation = FqName("konan.internal.Frozen") +private val intrinsicAnnotation = FqName("kotlin.native.internal.Intrinsic") +private val frozenAnnotation = FqName("kotlin.native.internal.Frozen") // TODO: don't forget to remove descriptor access here. internal val FunctionDescriptor.isIntrinsic: Boolean @@ -108,7 +108,7 @@ internal val arrayTypes = setOf( "kotlin.FloatArray", "kotlin.DoubleArray", "kotlin.BooleanArray", - "konan.ImmutableBinaryBlob" + "kotlin.native.ImmutableBinaryBlob" ) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/LegacyDescriptorUtils.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/LegacyDescriptorUtils.kt index 8394531fa79..85c9e1c963f 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/LegacyDescriptorUtils.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/LegacyDescriptorUtils.kt @@ -58,13 +58,13 @@ internal val ClassDescriptor.isArray: Boolean internal val ClassDescriptor.isInterface: Boolean get() = (this.kind == ClassKind.INTERFACE) -private val konanInternalPackageName = FqName.fromSegments(listOf("konan", "internal")) +private val kotlinNativeInternalPackageName = FqName.fromSegments(listOf("kotlin", "native", "internal")) /** * @return `konan.internal` member scope */ -internal val KonanBuiltIns.konanInternal: MemberScope - get() = this.builtInsModule.getPackage(konanInternalPackageName).memberScope +internal val KonanBuiltIns.kotlinNativeInternal: MemberScope + get() = this.builtInsModule.getPackage(kotlinNativeInternalPackageName).memberScope internal val KotlinType.isKFunctionType: Boolean get() { @@ -137,7 +137,7 @@ internal fun DeclarationDescriptor.allContainingDeclarations(): List { + "kotlin.native.internal.areEqualByValue" -> { val arg0 = args[0] val arg1 = args[1] assert (arg0.type == arg1.type, @@ -2119,7 +2119,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map { + "kotlin.native.internal.ieee754Equals" -> { val arg0 = args[0] val arg1 = args[1] assert (arg0.type == arg1.type, @@ -2130,7 +2130,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map return getContinuation() + "kotlin.native.internal.getContinuation" -> return getContinuation() } val interop = context.interopBuiltIns diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/LlvmDeclarations.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/LlvmDeclarations.kt index 0baa8487200..5e2d0e2d167 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/LlvmDeclarations.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/LlvmDeclarations.kt @@ -135,7 +135,7 @@ private fun Context.getDeclaredFields(classDescriptor: ClassDescriptor): List(var inner: T) { class Foo (val f: Int) { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { val A: Foo by Delegate(Foo(11)) var B: Foo by Delegate(Foo(11)) @@ -15,7 +15,7 @@ class Foo (val f: Int) { } interface FooTrait { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { val A: Foo by Delegate(Foo(11)) var B: Foo by Delegate(Foo(11)) diff --git a/backend.native/tests/external/codegen/box/extensionProperties/kt9897.kt b/backend.native/tests/external/codegen/box/extensionProperties/kt9897.kt index 3cae8d031d9..b65b93e4960 100644 --- a/backend.native/tests/external/codegen/box/extensionProperties/kt9897.kt +++ b/backend.native/tests/external/codegen/box/extensionProperties/kt9897.kt @@ -1,4 +1,4 @@ -@konan.ThreadLocal +@kotlin.native.ThreadLocal object Test { var z = "0" var l = 0L diff --git a/backend.native/tests/external/codegen/box/ieee754/equalsNaN.kt b/backend.native/tests/external/codegen/box/ieee754/equalsNaN.kt index f578e3d34e4..3198d0a818c 100644 --- a/backend.native/tests/external/codegen/box/ieee754/equalsNaN.kt +++ b/backend.native/tests/external/codegen/box/ieee754/equalsNaN.kt @@ -2,7 +2,7 @@ import kotlin.test.* -@konan.ThreadLocal +@kotlin.native.ThreadLocal object O { var equalsCalled: Boolean = false get(): Boolean { diff --git a/backend.native/tests/external/codegen/box/increment/classNaryGetSet.kt b/backend.native/tests/external/codegen/box/increment/classNaryGetSet.kt index 068aea7d336..9b909a4e8e2 100644 --- a/backend.native/tests/external/codegen/box/increment/classNaryGetSet.kt +++ b/backend.native/tests/external/codegen/box/increment/classNaryGetSet.kt @@ -1,4 +1,4 @@ -@konan.ThreadLocal +@kotlin.native.ThreadLocal object A { var x = 0 diff --git a/backend.native/tests/external/codegen/box/objects/useImportedMember.kt b/backend.native/tests/external/codegen/box/objects/useImportedMember.kt index 48dfb3fb0d1..670d03ae1df 100644 --- a/backend.native/tests/external/codegen/box/objects/useImportedMember.kt +++ b/backend.native/tests/external/codegen/box/objects/useImportedMember.kt @@ -18,7 +18,7 @@ open class BaseClass { get() = this } -@konan.ThreadLocal +@kotlin.native.ThreadLocal object C: BaseClass(), I { fun f(s: Int) = 1 fun f(s: String) = 2 diff --git a/backend.native/tests/external/codegen/box/objects/useImportedMemberFromCompanion.kt b/backend.native/tests/external/codegen/box/objects/useImportedMemberFromCompanion.kt index 6726dd928b9..58c46ecc0f3 100644 --- a/backend.native/tests/external/codegen/box/objects/useImportedMemberFromCompanion.kt +++ b/backend.native/tests/external/codegen/box/objects/useImportedMemberFromCompanion.kt @@ -19,7 +19,7 @@ open class BaseClass { } class Class { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object C: BaseClass(), I { fun f(s: Int) = 1 fun f(s: String) = 2 diff --git a/backend.native/tests/external/codegen/box/operatorConventions/operatorSetLambda.kt b/backend.native/tests/external/codegen/box/operatorConventions/operatorSetLambda.kt index 74d538b1900..cef08624bdd 100644 --- a/backend.native/tests/external/codegen/box/operatorConventions/operatorSetLambda.kt +++ b/backend.native/tests/external/codegen/box/operatorConventions/operatorSetLambda.kt @@ -1,6 +1,6 @@ // See KT-14999 -@konan.ThreadLocal +@kotlin.native.ThreadLocal object Obj { var key = "" var value = "" diff --git a/backend.native/tests/external/codegen/box/properties/classObjectProperties.kt b/backend.native/tests/external/codegen/box/properties/classObjectProperties.kt index 53c79de1997..53c0c4f7b68 100644 --- a/backend.native/tests/external/codegen/box/properties/classObjectProperties.kt +++ b/backend.native/tests/external/codegen/box/properties/classObjectProperties.kt @@ -1,6 +1,6 @@ class Test { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { public val prop1 : Int = 10 diff --git a/backend.native/tests/external/codegen/box/properties/kt4140.kt b/backend.native/tests/external/codegen/box/properties/kt4140.kt index c30d8a992ea..724ea4bf831 100644 --- a/backend.native/tests/external/codegen/box/properties/kt4140.kt +++ b/backend.native/tests/external/codegen/box/properties/kt4140.kt @@ -1,6 +1,6 @@ class TestObject() { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { var prop: Int = 1 get() = field++ diff --git a/backend.native/tests/external/codegen/box/properties/kt4252.kt b/backend.native/tests/external/codegen/box/properties/kt4252.kt index a8ed9f1b0bd..9e31831b347 100644 --- a/backend.native/tests/external/codegen/box/properties/kt4252.kt +++ b/backend.native/tests/external/codegen/box/properties/kt4252.kt @@ -2,7 +2,7 @@ class CallbackBlock {} public class Foo { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { private var bar = 0 } diff --git a/backend.native/tests/external/codegen/box/properties/kt4252_2.kt b/backend.native/tests/external/codegen/box/properties/kt4252_2.kt index d894e2d59da..746bb06b680 100644 --- a/backend.native/tests/external/codegen/box/properties/kt4252_2.kt +++ b/backend.native/tests/external/codegen/box/properties/kt4252_2.kt @@ -1,5 +1,5 @@ class Foo() { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { val bar = "OK"; var boo = "FAIL"; diff --git a/backend.native/tests/external/codegen/box/properties/kt4383.kt b/backend.native/tests/external/codegen/box/properties/kt4383.kt index 8959b00b7f3..783d2c23e46 100644 --- a/backend.native/tests/external/codegen/box/properties/kt4383.kt +++ b/backend.native/tests/external/codegen/box/properties/kt4383.kt @@ -4,7 +4,7 @@ class D { operator fun getValue(a: Any, p: KProperty<*>) { } } -@konan.ThreadLocal +@kotlin.native.ThreadLocal object P { val u = Unit val v by D() diff --git a/backend.native/tests/external/codegen/box/properties/kt8928.kt b/backend.native/tests/external/codegen/box/properties/kt8928.kt index 407414ec1dd..76da0b6e273 100644 --- a/backend.native/tests/external/codegen/box/properties/kt8928.kt +++ b/backend.native/tests/external/codegen/box/properties/kt8928.kt @@ -2,7 +2,7 @@ class App { fun init() { s = "OK" } - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { var s: String = "Fail" private set diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/accessor.kt b/backend.native/tests/external/codegen/box/properties/lateinit/accessor.kt index df9e96d343d..0ea93950456 100644 --- a/backend.native/tests/external/codegen/box/properties/lateinit/accessor.kt +++ b/backend.native/tests/external/codegen/box/properties/lateinit/accessor.kt @@ -8,7 +8,7 @@ public class A { return str } - @konan.ThreadLocal + @kotlin.native.ThreadLocal private companion object { private lateinit var str: String } diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/emptyLhs.kt b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/emptyLhs.kt index a1961bb5d64..e0191f26f44 100644 --- a/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/emptyLhs.kt +++ b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/emptyLhs.kt @@ -14,7 +14,7 @@ class Foo { } } -@konan.ThreadLocal +@kotlin.native.ThreadLocal object Bar { lateinit var p: String diff --git a/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/delegatedProperty.kt b/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/delegatedProperty.kt index 973b1d1f742..dfc8c6b0065 100644 --- a/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/delegatedProperty.kt +++ b/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/delegatedProperty.kt @@ -4,7 +4,7 @@ import kotlin.reflect.KProperty import kotlin.test.assertEquals -@konan.ThreadLocal +@kotlin.native.ThreadLocal object Delegate { lateinit var prop: KProperty<*> diff --git a/backend.native/tests/external/codegen/box/statics/incInClassObject.kt b/backend.native/tests/external/codegen/box/statics/incInClassObject.kt index d512b4c2227..2a6db13215f 100644 --- a/backend.native/tests/external/codegen/box/statics/incInClassObject.kt +++ b/backend.native/tests/external/codegen/box/statics/incInClassObject.kt @@ -1,5 +1,5 @@ class A { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { private var r: Int = 1; diff --git a/backend.native/tests/external/codegen/box/statics/incInObject.kt b/backend.native/tests/external/codegen/box/statics/incInObject.kt index ddbea69d3bd..1e4ee07cea5 100644 --- a/backend.native/tests/external/codegen/box/statics/incInObject.kt +++ b/backend.native/tests/external/codegen/box/statics/incInObject.kt @@ -1,4 +1,4 @@ -@konan.ThreadLocal +@kotlin.native.ThreadLocal object A { private var r: Int = 1; diff --git a/backend.native/tests/external/codegen/box/statics/kt8089.kt b/backend.native/tests/external/codegen/box/statics/kt8089.kt index 98461832f8a..1441b3511a6 100644 --- a/backend.native/tests/external/codegen/box/statics/kt8089.kt +++ b/backend.native/tests/external/codegen/box/statics/kt8089.kt @@ -1,5 +1,5 @@ class C { - @konan.ThreadLocal + @kotlin.native.ThreadLocal companion object { private val s: String private var s2: String diff --git a/backend.native/tests/interop/objc/smoke.kt b/backend.native/tests/interop/objc/smoke.kt index 0a9077856d5..a3c588ac007 100644 --- a/backend.native/tests/interop/objc/smoke.kt +++ b/backend.native/tests/interop/objc/smoke.kt @@ -1,6 +1,6 @@ import kotlinx.cinterop.* import objcSmoke.* -import konan.ref.* +import kotlin.native.ref.* import kotlin.test.* fun main(args: Array) { diff --git a/backend.native/tests/produce_dynamic/simple/hello.kt b/backend.native/tests/produce_dynamic/simple/hello.kt index d49378e7210..bfc1318435c 100644 --- a/backend.native/tests/produce_dynamic/simple/hello.kt +++ b/backend.native/tests/produce_dynamic/simple/hello.kt @@ -13,15 +13,15 @@ open class Base { open fun fooParam(arg0: String, arg1: Int) = println("Base.fooParam: $arg0 $arg1") - @konan.internal.CName(fullName = "", shortName = "strangeName") fun странноеИмя() = 111 + @kotlin.native.internal.CName(fullName = "", shortName = "strangeName") fun странноеИмя() = 111 } // Top level functions. -@konan.internal.CName(fullName = "topLevelFunctionFromC", shortName = "topLevelFunctionFromCShort") +@kotlin.native.internal.CName(fullName = "topLevelFunctionFromC", shortName = "topLevelFunctionFromCShort") fun topLevelFunction(x1: Int, x2: Int) = x1 - x2 -@konan.internal.CName("topLevelFunctionVoidFromC") +@kotlin.native.internal.CName("topLevelFunctionVoidFromC") fun topLevelFunctionVoid(x1: Int, pointer: COpaquePointer?) { assert(x1 == 42) assert(pointer == null) diff --git a/backend.native/tests/runtime/basic/worker_random.kt b/backend.native/tests/runtime/basic/worker_random.kt index 6416d778a3f..ffdcb7608e4 100644 --- a/backend.native/tests/runtime/basic/worker_random.kt +++ b/backend.native/tests/runtime/basic/worker_random.kt @@ -1,6 +1,6 @@ package runtime.basic.worker_random -import konan.worker.* +import kotlin.native.worker.* import kotlin.collections.* import kotlin.random.* import kotlin.system.* diff --git a/backend.native/tests/runtime/collections/array3.kt b/backend.native/tests/runtime/collections/array3.kt index 6ae54254a1f..1c7c035487d 100644 --- a/backend.native/tests/runtime/collections/array3.kt +++ b/backend.native/tests/runtime/collections/array3.kt @@ -2,7 +2,7 @@ package runtime.collections.array3 import kotlin.test.* -import konan.* +import kotlin.native.* @Test fun runTest() { val data = immutableBinaryBlobOf(0x1, 0x2, 0x3, 0x7, 0x8, 0x9, 0x80, 0xff) diff --git a/backend.native/tests/runtime/memory/cycles0.kt b/backend.native/tests/runtime/memory/cycles0.kt index 6537982d726..516b5a7fe5e 100644 --- a/backend.native/tests/runtime/memory/cycles0.kt +++ b/backend.native/tests/runtime/memory/cycles0.kt @@ -43,7 +43,7 @@ fun createCycles(junk: Node) { // Create outer link from cyclic garbage. val outer = Node(42, null, null, null) createCycles(outer) - konan.internal.GC.collect() + kotlin.native.internal.GC.collect() // Ensure outer is not collected. println(outer.data) } diff --git a/backend.native/tests/runtime/memory/cycles1.kt b/backend.native/tests/runtime/memory/cycles1.kt index a6cdae98300..19e7442433b 100644 --- a/backend.native/tests/runtime/memory/cycles1.kt +++ b/backend.native/tests/runtime/memory/cycles1.kt @@ -1,11 +1,11 @@ package runtime.memory.cycles1 import kotlin.test.* -import konan.ref.* +import kotlin.native.ref.* @Test fun runTest() { val weakRefToTrashCycle = createLoop() - konan.internal.GC.collect() + kotlin.native.internal.GC.collect() assertNull(weakRefToTrashCycle.get()) } diff --git a/backend.native/tests/runtime/memory/only_gc.kt b/backend.native/tests/runtime/memory/only_gc.kt index b2da7c12861..27e1a022574 100644 --- a/backend.native/tests/runtime/memory/only_gc.kt +++ b/backend.native/tests/runtime/memory/only_gc.kt @@ -1,4 +1,4 @@ fun main(args: Array) { - konan.internal.GC.collect() + kotlin.native.internal.GC.collect() } diff --git a/backend.native/tests/runtime/memory/weak0.kt b/backend.native/tests/runtime/memory/weak0.kt index 011f661a305..91a6a2d3673 100644 --- a/backend.native/tests/runtime/memory/weak0.kt +++ b/backend.native/tests/runtime/memory/weak0.kt @@ -1,7 +1,7 @@ package runtime.memory.weak0 import kotlin.test.* -import konan.ref.* +import kotlin.native.ref.* data class Data(val s: String) diff --git a/backend.native/tests/runtime/memory/weak1.kt b/backend.native/tests/runtime/memory/weak1.kt index 800029a8e2d..64b9348689b 100644 --- a/backend.native/tests/runtime/memory/weak1.kt +++ b/backend.native/tests/runtime/memory/weak1.kt @@ -1,7 +1,7 @@ package runtime.memory.weak1 import kotlin.test.* -import konan.ref.* +import kotlin.native.ref.* class Node(var next: Node?) @@ -10,6 +10,6 @@ class Node(var next: Node?) val node2 = Node(node1) node1.next = node2 - konan.ref.WeakReference(node1) + kotlin.native.ref.WeakReference(node1) println("OK") } diff --git a/backend.native/tests/runtime/workers/atomic0.kt b/backend.native/tests/runtime/workers/atomic0.kt index 84b36b39c25..bce1a50eefd 100644 --- a/backend.native/tests/runtime/workers/atomic0.kt +++ b/backend.native/tests/runtime/workers/atomic0.kt @@ -2,7 +2,7 @@ package runtime.workers.atomic0 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* fun test1(workers: Array) { val atomic = AtomicInt(15) diff --git a/backend.native/tests/runtime/workers/enum_identity.kt b/backend.native/tests/runtime/workers/enum_identity.kt index 233b4bebc26..be3bd1905b0 100644 --- a/backend.native/tests/runtime/workers/enum_identity.kt +++ b/backend.native/tests/runtime/workers/enum_identity.kt @@ -1,7 +1,7 @@ package runtime.workers.enum_identity import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* enum class A { A, B diff --git a/backend.native/tests/runtime/workers/freeze0.kt b/backend.native/tests/runtime/workers/freeze0.kt index 6a5f9355f74..267faa03197 100644 --- a/backend.native/tests/runtime/workers/freeze0.kt +++ b/backend.native/tests/runtime/workers/freeze0.kt @@ -18,7 +18,7 @@ package runtime.workers.freeze0 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* data class SharedDataMember(val double: Double) diff --git a/backend.native/tests/runtime/workers/freeze1.kt b/backend.native/tests/runtime/workers/freeze1.kt index f3e17fd9d97..022373f5fe8 100644 --- a/backend.native/tests/runtime/workers/freeze1.kt +++ b/backend.native/tests/runtime/workers/freeze1.kt @@ -18,7 +18,7 @@ package runtime.workers.freeze1 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* data class Node(var previous: Node?, var data: Int) diff --git a/backend.native/tests/runtime/workers/freeze2.kt b/backend.native/tests/runtime/workers/freeze2.kt index d2aa907cd25..b3455a794eb 100644 --- a/backend.native/tests/runtime/workers/freeze2.kt +++ b/backend.native/tests/runtime/workers/freeze2.kt @@ -18,7 +18,7 @@ package runtime.workers.freeze2 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* data class Data(var int: Int) diff --git a/backend.native/tests/runtime/workers/freeze3.kt b/backend.native/tests/runtime/workers/freeze3.kt index aa9a518b33d..62d8a1f7489 100644 --- a/backend.native/tests/runtime/workers/freeze3.kt +++ b/backend.native/tests/runtime/workers/freeze3.kt @@ -2,13 +2,13 @@ package runtime.workers.freeze3 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* object Immutable { var x = 1 } -@konan.ThreadLocal +@kotlin.native.ThreadLocal object Mutable { var x = 2 } diff --git a/backend.native/tests/runtime/workers/freeze4.kt b/backend.native/tests/runtime/workers/freeze4.kt index 620a95cbef6..4c36e29fcc4 100644 --- a/backend.native/tests/runtime/workers/freeze4.kt +++ b/backend.native/tests/runtime/workers/freeze4.kt @@ -2,7 +2,7 @@ package runtime.workers.freeze4 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* data class Data(val x: Int, val s: String, val next: Data? = null) diff --git a/backend.native/tests/runtime/workers/freeze_stress.kt b/backend.native/tests/runtime/workers/freeze_stress.kt index 72ba7464ce9..a2e26347ab0 100644 --- a/backend.native/tests/runtime/workers/freeze_stress.kt +++ b/backend.native/tests/runtime/workers/freeze_stress.kt @@ -2,7 +2,7 @@ package runtime.workers.freeze_stress import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* class Random(private var seed: Int) { fun next(): Int { diff --git a/backend.native/tests/runtime/workers/lazy0.kt b/backend.native/tests/runtime/workers/lazy0.kt index db7baaee5cd..1d370582672 100644 --- a/backend.native/tests/runtime/workers/lazy0.kt +++ b/backend.native/tests/runtime/workers/lazy0.kt @@ -2,7 +2,7 @@ package runtime.workers.lazy0 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* data class Data(val x: Int, val y: String) diff --git a/backend.native/tests/runtime/workers/worker0.kt b/backend.native/tests/runtime/workers/worker0.kt index ebdf02f4242..4cd56af8be8 100644 --- a/backend.native/tests/runtime/workers/worker0.kt +++ b/backend.native/tests/runtime/workers/worker0.kt @@ -2,7 +2,7 @@ package runtime.workers.worker0 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* @Test fun runTest() { val worker = startWorker() diff --git a/backend.native/tests/runtime/workers/worker1.kt b/backend.native/tests/runtime/workers/worker1.kt index 9b66585faaa..0e8a0493b15 100644 --- a/backend.native/tests/runtime/workers/worker1.kt +++ b/backend.native/tests/runtime/workers/worker1.kt @@ -2,7 +2,7 @@ package runtime.workers.worker1 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* @Test fun runTest() { val COUNT = 5 diff --git a/backend.native/tests/runtime/workers/worker2.kt b/backend.native/tests/runtime/workers/worker2.kt index 5cf923b1e20..b2b2c2cf719 100644 --- a/backend.native/tests/runtime/workers/worker2.kt +++ b/backend.native/tests/runtime/workers/worker2.kt @@ -2,7 +2,7 @@ package runtime.workers.worker2 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* data class WorkerArgument(val intParam: Int, val stringParam: String) data class WorkerResult(val intResult: Int, val stringResult: String) diff --git a/backend.native/tests/runtime/workers/worker3.kt b/backend.native/tests/runtime/workers/worker3.kt index 99a40798fb8..1dc6d69405b 100644 --- a/backend.native/tests/runtime/workers/worker3.kt +++ b/backend.native/tests/runtime/workers/worker3.kt @@ -2,7 +2,7 @@ package runtime.workers.worker3 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* data class DataParam(var int: Int) data class WorkerArgument(val intParam: Int, val dataParam: DataParam) diff --git a/backend.native/tests/runtime/workers/worker4.kt b/backend.native/tests/runtime/workers/worker4.kt index 0855d8975d8..a87eb17252b 100644 --- a/backend.native/tests/runtime/workers/worker4.kt +++ b/backend.native/tests/runtime/workers/worker4.kt @@ -2,7 +2,7 @@ package runtime.workers.worker4 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* @Test fun runTest() { val worker = startWorker() diff --git a/backend.native/tests/runtime/workers/worker5.kt b/backend.native/tests/runtime/workers/worker5.kt index a1d8cdd6de1..1aeb2600136 100644 --- a/backend.native/tests/runtime/workers/worker5.kt +++ b/backend.native/tests/runtime/workers/worker5.kt @@ -2,7 +2,7 @@ package runtime.workers.worker5 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* @Test fun runTest() { val worker = startWorker() diff --git a/backend.native/tests/runtime/workers/worker6.kt b/backend.native/tests/runtime/workers/worker6.kt index 6219b8e5e90..a00fd7b9d67 100644 --- a/backend.native/tests/runtime/workers/worker6.kt +++ b/backend.native/tests/runtime/workers/worker6.kt @@ -2,7 +2,7 @@ package runtime.workers.worker6 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* @Test fun runTest() { val worker = startWorker() diff --git a/backend.native/tests/runtime/workers/worker7.kt b/backend.native/tests/runtime/workers/worker7.kt index 18b520c9642..1de1fe444ad 100644 --- a/backend.native/tests/runtime/workers/worker7.kt +++ b/backend.native/tests/runtime/workers/worker7.kt @@ -2,7 +2,7 @@ package runtime.workers.worker7 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* @Test fun runTest() { val worker = startWorker() diff --git a/backend.native/tests/runtime/workers/worker8.kt b/backend.native/tests/runtime/workers/worker8.kt index d66c9ace8bc..29a6ac5987f 100644 --- a/backend.native/tests/runtime/workers/worker8.kt +++ b/backend.native/tests/runtime/workers/worker8.kt @@ -2,7 +2,7 @@ package runtime.workers.worker8 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* data class SharedDataMember(val double: Double) diff --git a/backend.native/tests/runtime/workers/worker9.kt b/backend.native/tests/runtime/workers/worker9.kt index 98c36a6ffa6..c9bd51d52a0 100644 --- a/backend.native/tests/runtime/workers/worker9.kt +++ b/backend.native/tests/runtime/workers/worker9.kt @@ -2,7 +2,7 @@ package runtime.workers.worker9 import kotlin.test.* -import konan.worker.* +import kotlin.native.worker.* @Test fun runTest() { withLock { println("zzz") } diff --git a/backend.native/tests/testing/annotations.kt b/backend.native/tests/testing/annotations.kt index deec15b52d7..5e4afc4260f 100644 --- a/backend.native/tests/testing/annotations.kt +++ b/backend.native/tests/testing/annotations.kt @@ -1,7 +1,7 @@ package kotlin.test.tests import kotlin.test.* -import konan.test.* +import kotlin.native.test.* @Ignore diff --git a/backend.native/tests/testing/custom_main.kt b/backend.native/tests/testing/custom_main.kt index ac9cfd70422..ef8a554d1d3 100644 --- a/backend.native/tests/testing/custom_main.kt +++ b/backend.native/tests/testing/custom_main.kt @@ -1,7 +1,7 @@ package kotlin.test.tests import kotlin.test.* -import konan.test.* +import kotlin.native.test.* @Test fun test() { diff --git a/extracted/konan.descriptors/src/main/kotlin/org/jetbrains/kotlin/resolve/konan/platform/KonanPlatform.kt b/extracted/konan.descriptors/src/main/kotlin/org/jetbrains/kotlin/resolve/konan/platform/KonanPlatform.kt index e2fa5f35859..4b0755a486a 100644 --- a/extracted/konan.descriptors/src/main/kotlin/org/jetbrains/kotlin/resolve/konan/platform/KonanPlatform.kt +++ b/extracted/konan.descriptors/src/main/kotlin/org/jetbrains/kotlin/resolve/konan/platform/KonanPlatform.kt @@ -9,7 +9,7 @@ import org.jetbrains.kotlin.storage.StorageManager object KonanPlatform : TargetPlatform("Konan") { override fun computePlatformSpecificDefaultImports(storageManager: StorageManager, result: MutableList) { - result.add(ImportPath.fromString("konan.*")) + result.add(ImportPath.fromString("kotlin.native.*")) } override val multiTargetPlatform = MultiTargetPlatform.Specific(platformName) diff --git a/runtime/src/launcher/kotlin/konan/start.kt b/runtime/src/launcher/kotlin/konan/start.kt index 521434f2e34..a5b54c63c03 100644 --- a/runtime/src/launcher/kotlin/konan/start.kt +++ b/runtime/src/launcher/kotlin/konan/start.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -import konan.internal.ExportForCppRuntime +import kotlin.native.internal.ExportForCppRuntime // This function is produced by the code generator given // the '-entry foo.bar.main' flag. diff --git a/runtime/src/main/cpp/Memory.cpp b/runtime/src/main/cpp/Memory.cpp index 0a51fea116f..1da5caeb591 100644 --- a/runtime/src/main/cpp/Memory.cpp +++ b/runtime/src/main/cpp/Memory.cpp @@ -1384,19 +1384,19 @@ void GarbageCollect() { #endif // USE_GC -void Kotlin_konan_internal_GC_collect(KRef) { +void Kotlin_native_internal_GC_collect(KRef) { #if USE_GC GarbageCollect(); #endif } -void Kotlin_konan_internal_GC_suspend(KRef) { +void Kotlin_native_internal_GC_suspend(KRef) { #if USE_GC memoryState->gcSuspendCount++; #endif } -void Kotlin_konan_internal_GC_resume(KRef) { +void Kotlin_native_internal_GC_resume(KRef) { #if USE_GC MemoryState* state = memoryState; if (state->gcSuspendCount > 0) { @@ -1409,7 +1409,7 @@ void Kotlin_konan_internal_GC_resume(KRef) { #endif } -void Kotlin_konan_internal_GC_stop(KRef) { +void Kotlin_native_internal_GC_stop(KRef) { #if USE_GC if (memoryState->toFree != nullptr) { GarbageCollect(); @@ -1421,7 +1421,7 @@ void Kotlin_konan_internal_GC_stop(KRef) { #endif } -void Kotlin_konan_internal_GC_start(KRef) { +void Kotlin_native_internal_GC_start(KRef) { #if USE_GC if (memoryState->toFree == nullptr) { memoryState->toFree = konanConstructInstance(); @@ -1430,7 +1430,7 @@ void Kotlin_konan_internal_GC_start(KRef) { #endif } -void Kotlin_konan_internal_GC_setThreshold(KRef, KInt value) { +void Kotlin_native_internal_GC_setThreshold(KRef, KInt value) { #if USE_GC if (value > 0) { initThreshold(memoryState, value); @@ -1438,7 +1438,7 @@ void Kotlin_konan_internal_GC_setThreshold(KRef, KInt value) { #endif } -KInt Kotlin_konan_internal_GC_getThreshold(KRef) { +KInt Kotlin_native_internal_GC_getThreshold(KRef) { #if USE_GC return memoryState->gcThreshold; #else diff --git a/runtime/src/main/cpp/Natives.cpp b/runtime/src/main/cpp/Natives.cpp index d13066ee9fc..65ee69ee6ba 100644 --- a/runtime/src/main/cpp/Natives.cpp +++ b/runtime/src/main/cpp/Natives.cpp @@ -44,7 +44,7 @@ OBJ_GETTER0(Kotlin_getCurrentStackTrace) { } // TODO: consider handling it with compiler magic instead. -OBJ_GETTER0(Kotlin_konan_internal_undefined) { +OBJ_GETTER0(Kotlin_native_internal_undefined) { RETURN_OBJ(nullptr); } diff --git a/runtime/src/main/cpp/Natives.h b/runtime/src/main/cpp/Natives.h index f9b455ae14f..8e5b0f40734 100644 --- a/runtime/src/main/cpp/Natives.h +++ b/runtime/src/main/cpp/Natives.h @@ -131,10 +131,10 @@ OBJ_GETTER(Kotlin_String_subSequence, KString thiz, KInt startIndex, KInt endInd OBJ_GETTER0(Kotlin_getCurrentStackTrace); -OBJ_GETTER0(Kotlin_konan_internal_undefined); +OBJ_GETTER0(Kotlin_native_internal_undefined); -void Kotlin_konan_internal_GC_suspend(KRef); -void Kotlin_konan_internal_GC_resume(KRef); +void Kotlin_native_internal_GC_suspend(KRef); +void Kotlin_native_internal_GC_resume(KRef); #ifdef __cplusplus } diff --git a/runtime/src/main/cpp/dtoa/dblparse.cpp b/runtime/src/main/cpp/dtoa/dblparse.cpp index 49407e46e7d..5a836c1b7f3 100644 --- a/runtime/src/main/cpp/dtoa/dblparse.cpp +++ b/runtime/src/main/cpp/dtoa/dblparse.cpp @@ -39,9 +39,9 @@ #define DEFAULT_WIDTH MAX_ACCURACY_WIDTH extern "C" { -KDouble Konan_FloatingPointParser_parseDoubleImpl (KString s, KInt e); +KDouble Kotlin_native_FloatingPointParser_parseDoubleImpl (KString s, KInt e); -void Konan_NumberConverter_bigIntDigitGeneratorInstImpl (KRef results, +void Kotlin_native_NumberConverter_bigIntDigitGeneratorInstImpl (KRef results, KRef uArray, KLong f, KInt e, @@ -49,16 +49,16 @@ void Konan_NumberConverter_bigIntDigitGeneratorInstImpl (KRef results, KBoolean mantissaIsZero, KInt p); -KDouble Konan_NumberConverter_ceil(KDouble x) { +KDouble Kotlin_native_NumberConverter_ceil(KDouble x) { return ceil(x); } void Kotlin_IntArray_set(KRef thiz, KInt index, KInt value); -KDouble Konan_long_bits_to_double(KLong x); +KDouble Kotlin_native_long_bits_to_double(KLong x); } -KDouble Konan_long_bits_to_double(KLong x) { +KDouble Kotlin_native_long_bits_to_double(KLong x) { union { int64_t x; double d; @@ -638,7 +638,7 @@ OutOfMemory: #pragma optimize("",on) /*restore optimizations */ #endif -KDouble Konan_FloatingPointParser_parseDoubleImpl (KString s, KInt e) +KDouble Kotlin_native_FloatingPointParser_parseDoubleImpl (KString s, KInt e) { const KChar* utf16 = CharArrayAddressOfElementAt(s, 0); KStdString utf8; @@ -691,7 +691,7 @@ KDouble Konan_FloatingPointParser_parseDoubleImpl (KString s, KInt e) * 1.2341234124312331E107 * */ -void Konan_NumberConverter_bigIntDigitGeneratorInstImpl (KRef results, +void Kotlin_native_NumberConverter_bigIntDigitGeneratorInstImpl (KRef results, KRef uArray, KLong f, KInt e, diff --git a/runtime/src/main/cpp/dtoa/fltparse.cpp b/runtime/src/main/cpp/dtoa/fltparse.cpp index 5988121e6fe..d72f9c07584 100644 --- a/runtime/src/main/cpp/dtoa/fltparse.cpp +++ b/runtime/src/main/cpp/dtoa/fltparse.cpp @@ -39,7 +39,7 @@ #define DEFAULT_WIDTH MAX_ACCURACY_WIDTH -extern "C" KFloat Konan_int_bits_to_float(KInt x) { +extern "C" KFloat Kotlin_native_int_bits_to_float(KInt x) { union { int32_t x; float f; @@ -538,7 +538,7 @@ OutOfMemory: #endif extern "C" KFloat -Konan_FloatingPointParser_parseFloatImpl(KString s, KInt e) +Kotlin_native_FloatingPointParser_parseFloatImpl(KString s, KInt e) { const KChar* utf16 = CharArrayAddressOfElementAt(s, 0); KStdString utf8; diff --git a/runtime/src/main/kotlin/kotlin/Array.kt b/runtime/src/main/kotlin/kotlin/Array.kt index a06e3e85b8d..7216c3fb4b6 100644 --- a/runtime/src/main/kotlin/kotlin/Array.kt +++ b/runtime/src/main/kotlin/kotlin/Array.kt @@ -15,8 +15,8 @@ */ package kotlin -import konan.internal.ExportForCompiler -import konan.internal.InlineConstructor +import kotlin.native.internal.ExportForCompiler +import kotlin.native.internal.InlineConstructor // TODO: remove that, as RTTI shall be per instantiation. @ExportTypeInfo("theArrayTypeInfo") diff --git a/runtime/src/main/kotlin/kotlin/Arrays.kt b/runtime/src/main/kotlin/kotlin/Arrays.kt index f3b0fdabca0..39c93322f91 100644 --- a/runtime/src/main/kotlin/kotlin/Arrays.kt +++ b/runtime/src/main/kotlin/kotlin/Arrays.kt @@ -19,7 +19,7 @@ package kotlin -import konan.internal.InlineConstructor +import kotlin.native.internal.InlineConstructor import kotlin.collections.* import kotlin.internal.PureReifiable import kotlin.util.sortArrayComparable diff --git a/runtime/src/main/kotlin/kotlin/Boolean.kt b/runtime/src/main/kotlin/kotlin/Boolean.kt index 79fecf662c9..7fef6073ba6 100644 --- a/runtime/src/main/kotlin/kotlin/Boolean.kt +++ b/runtime/src/main/kotlin/kotlin/Boolean.kt @@ -20,7 +20,7 @@ package kotlin * Represents a value which is either `true` or `false`. On the JVM, non-nullable values of this type are * represented as values of the primitive type `boolean`. */ -public final class Boolean private constructor(private val value: konan.internal.BooleanValue) : Comparable { +public final class Boolean private constructor(private val value: kotlin.native.internal.BooleanValue) : Comparable { /** * Returns the inverse of this boolean. */ @@ -49,10 +49,10 @@ public final class Boolean private constructor(private val value: konan.internal external public override fun compareTo(other: Boolean): Int // Konan-specific. - public fun equals(other: Boolean): Boolean = konan.internal.areEqualByValue(this, other) + public fun equals(other: Boolean): Boolean = kotlin.native.internal.areEqualByValue(this, other) public override fun equals(other: Any?): Boolean = - other is Boolean && konan.internal.areEqualByValue(this, other) + other is Boolean && kotlin.native.internal.areEqualByValue(this, other) public override fun toString() = if (this) "true" else "false" diff --git a/runtime/src/main/kotlin/kotlin/Char.kt b/runtime/src/main/kotlin/kotlin/Char.kt index edd16317549..9edfde262ee 100644 --- a/runtime/src/main/kotlin/kotlin/Char.kt +++ b/runtime/src/main/kotlin/kotlin/Char.kt @@ -20,7 +20,7 @@ package kotlin * Represents a 16-bit Unicode character. * On the JVM, non-nullable values of this type are represented as values of the primitive type `char`. */ -public final class Char private constructor(private val value: konan.internal.ShortValue) : Comparable { +public final class Char private constructor(private val value: kotlin.native.internal.ShortValue) : Comparable { /** * Compares this value with the specified value for order. diff --git a/runtime/src/main/kotlin/kotlin/Primitives.kt b/runtime/src/main/kotlin/kotlin/Primitives.kt index 2e9e1a14319..a03aaab0da4 100644 --- a/runtime/src/main/kotlin/kotlin/Primitives.kt +++ b/runtime/src/main/kotlin/kotlin/Primitives.kt @@ -16,13 +16,13 @@ package kotlin -import konan.internal.NumberConverter +import kotlin.native.internal.NumberConverter /** * Represents a 8-bit signed integer. * On the JVM, non-nullable values of this type are represented as values of the primitive type `byte`. */ -public final class Byte private constructor(private val value: konan.internal.ByteValue) : Number(), Comparable { +public final class Byte private constructor(private val value: kotlin.native.internal.ByteValue) : Number(), Comparable { companion object { /** * A constant holding the minimum value an instance of Byte can have. @@ -219,10 +219,10 @@ public final class Byte private constructor(private val value: konan.internal.By } // Konan-specific. - public fun equals(other: Byte): Boolean = konan.internal.areEqualByValue(this, other) + public fun equals(other: Byte): Boolean = kotlin.native.internal.areEqualByValue(this, other) public override fun equals(other: Any?): Boolean = - other is Byte && konan.internal.areEqualByValue(this, other) + other is Byte && kotlin.native.internal.areEqualByValue(this, other) @SymbolName("Kotlin_Byte_toString") external public override fun toString(): String @@ -236,7 +236,7 @@ public final class Byte private constructor(private val value: konan.internal.By * Represents a 16-bit signed integer. * On the JVM, non-nullable values of this type are represented as values of the primitive type `short`. */ -public final class Short private constructor(private val value: konan.internal.ShortValue) : Number(), Comparable { +public final class Short private constructor(private val value: kotlin.native.internal.ShortValue) : Number(), Comparable { companion object { /** * A constant holding the minimum value an instance of Short can have. @@ -433,10 +433,10 @@ public final class Short private constructor(private val value: konan.internal.S external public override fun toDouble(): Double // Konan-specific. - public fun equals(other: Short): Boolean = konan.internal.areEqualByValue(this, other) + public fun equals(other: Short): Boolean = kotlin.native.internal.areEqualByValue(this, other) public override fun equals(other: Any?): Boolean = - other is Short && konan.internal.areEqualByValue(this, other) + other is Short && kotlin.native.internal.areEqualByValue(this, other) @SymbolName("Kotlin_Short_toString") external public override fun toString(): String @@ -450,7 +450,7 @@ public final class Short private constructor(private val value: konan.internal.S * Represents a 32-bit signed integer. * On the JVM, non-nullable values of this type are represented as values of the primitive type `int`. */ -public final class Int private constructor(private val value: konan.internal.IntValue) : Number(), Comparable { +public final class Int private constructor(private val value: kotlin.native.internal.IntValue) : Number(), Comparable { companion object { /** * A constant holding the minimum value an instance of Int can have. @@ -669,10 +669,10 @@ public final class Int private constructor(private val value: konan.internal.Int external public override fun toDouble(): Double // Konan-specific. - public fun equals(other: Int): Boolean = konan.internal.areEqualByValue(this, other) + public fun equals(other: Int): Boolean = kotlin.native.internal.areEqualByValue(this, other) public override fun equals(other: Any?): Boolean = - other is Int && konan.internal.areEqualByValue(this, other) + other is Int && kotlin.native.internal.areEqualByValue(this, other) @SymbolName("Kotlin_Int_toString") external public override fun toString(): String @@ -686,7 +686,7 @@ public final class Int private constructor(private val value: konan.internal.Int * Represents a 64-bit signed integer. * On the JVM, non-nullable values of this type are represented as values of the primitive type `long`. */ -public final class Long private constructor(private val value: konan.internal.LongValue) : Number(), Comparable { +public final class Long private constructor(private val value: kotlin.native.internal.LongValue) : Number(), Comparable { companion object { /** * A constant holding the minimum value an instance of Long can have. @@ -905,10 +905,10 @@ public final class Long private constructor(private val value: konan.internal.Lo external public override fun toDouble(): Double // Konan-specific. - public fun equals(other: Long): Boolean = konan.internal.areEqualByValue(this, other) + public fun equals(other: Long): Boolean = kotlin.native.internal.areEqualByValue(this, other) public override fun equals(other: Any?): Boolean = - other is Long && konan.internal.areEqualByValue(this, other) + other is Long && kotlin.native.internal.areEqualByValue(this, other) @SymbolName("Kotlin_Long_toString") external public override fun toString(): String @@ -922,7 +922,7 @@ public final class Long private constructor(private val value: konan.internal.Lo * Represents a single-precision 32-bit IEEE 754 floating point number. * On the JVM, non-nullable values of this type are represented as values of the primitive type `float`. */ -public final class Float private constructor(private val value: konan.internal.FloatValue) : Number(), Comparable { +public final class Float private constructor(private val value: kotlin.native.internal.FloatValue) : Number(), Comparable { companion object { /** * A constant holding the smallest *positive* nonzero value of Float. @@ -1141,7 +1141,7 @@ public final class Float private constructor(private val value: konan.internal.F * Represents a double-precision 64-bit IEEE 754 floating point number. * On the JVM, non-nullable values of this type are represented as values of the primitive type `double`. */ -public final class Double private constructor(private val value: konan.internal.DoubleValue) : Number(), Comparable { +public final class Double private constructor(private val value: kotlin.native.internal.DoubleValue) : Number(), Comparable { companion object { /** * A constant holding the smallest *positive* nonzero value of Double. diff --git a/runtime/src/main/kotlin/kotlin/String.kt b/runtime/src/main/kotlin/kotlin/String.kt index ef2f57986f5..da13b329fc0 100644 --- a/runtime/src/main/kotlin/kotlin/String.kt +++ b/runtime/src/main/kotlin/kotlin/String.kt @@ -17,7 +17,7 @@ package kotlin @ExportTypeInfo("theStringTypeInfo") -@konan.internal.Frozen +@kotlin.native.internal.Frozen public final class String : Comparable, CharSequence { public companion object { } diff --git a/runtime/src/main/kotlin/kotlin/collections/Arrays.kt b/runtime/src/main/kotlin/kotlin/collections/Arrays.kt index 430ad8884ce..884b9d6e113 100644 --- a/runtime/src/main/kotlin/kotlin/collections/Arrays.kt +++ b/runtime/src/main/kotlin/kotlin/collections/Arrays.kt @@ -16,7 +16,7 @@ package kotlin.collections -import konan.internal.InlineConstructor +import kotlin.native.internal.InlineConstructor import kotlin.collections.* import kotlin.internal.PureReifiable import kotlin.util.sortArrayComparable diff --git a/runtime/src/main/kotlin/kotlin/collections/HashMap.kt b/runtime/src/main/kotlin/kotlin/collections/HashMap.kt index 1f8f4a868af..b6d4d475fbc 100644 --- a/runtime/src/main/kotlin/kotlin/collections/HashMap.kt +++ b/runtime/src/main/kotlin/kotlin/collections/HashMap.kt @@ -16,7 +16,7 @@ package kotlin.collections -import konan.worker.isFrozen +import kotlin.native.worker.isFrozen actual class HashMap private constructor( private var keysArray: Array, @@ -671,7 +671,7 @@ internal class HashMapValues internal constructor( internal class HashMapEntrySet internal constructor( val backing: HashMap -) : MutableSet>, konan.internal.KonanSet> { +) : MutableSet>, kotlin.native.internal.KonanSet> { override val size: Int get() = backing.size override fun isEmpty(): Boolean = backing.isEmpty() diff --git a/runtime/src/main/kotlin/kotlin/collections/HashSet.kt b/runtime/src/main/kotlin/kotlin/collections/HashSet.kt index b3b69403bce..7630cd04f0f 100644 --- a/runtime/src/main/kotlin/kotlin/collections/HashSet.kt +++ b/runtime/src/main/kotlin/kotlin/collections/HashSet.kt @@ -18,7 +18,7 @@ package kotlin.collections actual class HashSet internal constructor( val backing: HashMap -) : MutableSet, AbstractMutableCollection(), konan.internal.KonanSet { +) : MutableSet, AbstractMutableCollection(), kotlin.native.internal.KonanSet { actual constructor() : this(HashMap()) diff --git a/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt b/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt index 9ab1b08ffc8..05c8581b697 100644 --- a/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt +++ b/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt @@ -19,7 +19,7 @@ package kotlin.coroutines.experimental.intrinsics import kotlin.coroutines.experimental.Continuation import kotlin.coroutines.experimental.CoroutineContext import kotlin.coroutines.experimental.processBareContinuationResume -import konan.internal.* +import kotlin.native.internal.* /** diff --git a/runtime/src/main/kotlin/konan/Annotations.kt b/runtime/src/main/kotlin/kotlin/native/Annotations.kt similarity index 99% rename from runtime/src/main/kotlin/konan/Annotations.kt rename to runtime/src/main/kotlin/kotlin/native/Annotations.kt index dd0b3e5ea70..c1ad580c2ae 100644 --- a/runtime/src/main/kotlin/konan/Annotations.kt +++ b/runtime/src/main/kotlin/kotlin/native/Annotations.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan +package kotlin.native import kotlin.reflect.KClass diff --git a/runtime/src/main/kotlin/konan/BinaryBlob.kt b/runtime/src/main/kotlin/kotlin/native/BinaryBlob.kt similarity index 96% rename from runtime/src/main/kotlin/konan/BinaryBlob.kt rename to runtime/src/main/kotlin/kotlin/native/BinaryBlob.kt index 27090d8d5c6..b75dbd15f2c 100644 --- a/runtime/src/main/kotlin/konan/BinaryBlob.kt +++ b/runtime/src/main/kotlin/kotlin/native/BinaryBlob.kt @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package konan +package kotlin.native -import konan.internal.* +import kotlin.native.internal.* import kotlinx.cinterop.* /** @@ -63,7 +63,7 @@ public fun ImmutableBinaryBlob.toByteArray() = toByteArray(0, size) // to C API. public fun ImmutableBinaryBlob.asCPointer(offset: Int) = interpretCPointer(asCPointerImpl(offset)) @SymbolName("Kotlin_ImmutableBinaryBlob_asCPointerImpl") -private external fun ImmutableBinaryBlob.asCPointerImpl(offset: Int): konan.internal.NativePtr +private external fun ImmutableBinaryBlob.asCPointerImpl(offset: Int): kotlin.native.internal.NativePtr // Creates ImmutableBinaryBlob out of compile-time constant data. // This method accepts Short type, so that values in range 0x80 .. 0xff can be diff --git a/runtime/src/main/kotlin/konan/TypedArrays.kt b/runtime/src/main/kotlin/kotlin/native/TypedArrays.kt similarity index 97% rename from runtime/src/main/kotlin/konan/TypedArrays.kt rename to runtime/src/main/kotlin/kotlin/native/TypedArrays.kt index 5b3f1bc51f4..27ef0c88428 100644 --- a/runtime/src/main/kotlin/konan/TypedArrays.kt +++ b/runtime/src/main/kotlin/kotlin/native/TypedArrays.kt @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package konan +package kotlin.native -import konan.SymbolName +import kotlin.native.SymbolName @SymbolName("Kotlin_ByteArray_getCharAt") external fun ByteArray.charAt(index: Int): Char diff --git a/runtime/src/main/kotlin/konan/concurrent.kt b/runtime/src/main/kotlin/kotlin/native/concurrent.kt similarity index 100% rename from runtime/src/main/kotlin/konan/concurrent.kt rename to runtime/src/main/kotlin/kotlin/native/concurrent.kt diff --git a/runtime/src/main/kotlin/konan/internal/Annotations.kt b/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt similarity index 98% rename from runtime/src/main/kotlin/konan/internal/Annotations.kt rename to runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt index 96350df20f5..c455f18a3a3 100644 --- a/runtime/src/main/kotlin/konan/internal/Annotations.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal /** * Makes this function to be possible to call by given name from C++ part of runtime using C ABI. diff --git a/runtime/src/main/kotlin/konan/internal/Boxing.kt b/runtime/src/main/kotlin/kotlin/native/internal/Boxing.kt similarity index 98% rename from runtime/src/main/kotlin/konan/internal/Boxing.kt rename to runtime/src/main/kotlin/kotlin/native/internal/Boxing.kt index a3c77e41bbc..e04e2fbe618 100644 --- a/runtime/src/main/kotlin/konan/internal/Boxing.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/Boxing.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal @SymbolName("getCachedBooleanBox") external fun getCachedBooleanBox(value: Boolean): Boolean? diff --git a/runtime/src/main/kotlin/konan/internal/Coroutines.kt b/runtime/src/main/kotlin/kotlin/native/internal/Coroutines.kt similarity index 99% rename from runtime/src/main/kotlin/konan/internal/Coroutines.kt rename to runtime/src/main/kotlin/kotlin/native/internal/Coroutines.kt index 2d8e421df29..e2e15c910a0 100644 --- a/runtime/src/main/kotlin/konan/internal/Coroutines.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/Coroutines.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.intrinsics.* diff --git a/runtime/src/main/kotlin/konan/internal/DefaultConstructorMarker.kt b/runtime/src/main/kotlin/kotlin/native/internal/DefaultConstructorMarker.kt similarity index 95% rename from runtime/src/main/kotlin/konan/internal/DefaultConstructorMarker.kt rename to runtime/src/main/kotlin/kotlin/native/internal/DefaultConstructorMarker.kt index 6179182ae7a..5cb9a43cdcb 100644 --- a/runtime/src/main/kotlin/konan/internal/DefaultConstructorMarker.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/DefaultConstructorMarker.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal @ExportForCompiler internal object DefaultConstructorMarker; diff --git a/runtime/src/main/kotlin/konan/internal/FloatingPointParser.kt b/runtime/src/main/kotlin/kotlin/native/internal/FloatingPointParser.kt similarity index 98% rename from runtime/src/main/kotlin/konan/internal/FloatingPointParser.kt rename to runtime/src/main/kotlin/kotlin/native/internal/FloatingPointParser.kt index 214dab99731..437cf360d03 100644 --- a/runtime/src/main/kotlin/konan/internal/FloatingPointParser.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/FloatingPointParser.kt @@ -15,7 +15,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlin.comparisons.* @@ -38,7 +38,7 @@ import kotlin.comparisons.* * @exception NumberFormatException * * if the String doesn't represent a positive integer value */ -@SymbolName("Konan_FloatingPointParser_parseDoubleImpl") +@SymbolName("Kotlin_native_FloatingPointParser_parseDoubleImpl") private external fun parseDoubleImpl(s: String, e: Int): Double /** @@ -60,7 +60,7 @@ private external fun parseDoubleImpl(s: String, e: Int): Double * @exception NumberFormatException * * if the String doesn't represent a positive integer value */ -@SymbolName("Konan_FloatingPointParser_parseFloatImpl") +@SymbolName("Kotlin_native_FloatingPointParser_parseFloatImpl") private external fun parseFloatImpl(s: String, e: Int): Float /** diff --git a/runtime/src/main/kotlin/konan/internal/GC.kt b/runtime/src/main/kotlin/kotlin/native/internal/GC.kt similarity index 85% rename from runtime/src/main/kotlin/konan/internal/GC.kt rename to runtime/src/main/kotlin/kotlin/native/internal/GC.kt index 149a7fe510e..3342b48daad 100644 --- a/runtime/src/main/kotlin/konan/internal/GC.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/GC.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal // Cycle garbage collector interface. // @@ -33,25 +33,25 @@ package konan.internal object GC { // To force garbage collection immediately, unless collector is stopped // with stop() operation. Even if GC is suspended, collect() still triggers collection. - @SymbolName("Kotlin_konan_internal_GC_collect") + @SymbolName("Kotlin_native_internal_GC_collect") external fun collect() // Suspend garbage collection. Release candidates are still collected, but // GC algorithm is not executed. - @SymbolName("Kotlin_konan_internal_GC_suspend") + @SymbolName("Kotlin_native_internal_GC_suspend") external fun suspend() // Resume garbage collection. Can potentially lead to GC immediately. - @SymbolName("Kotlin_konan_internal_GC_resume") + @SymbolName("Kotlin_native_internal_GC_resume") external fun resume() // Stop garbage collection. Cyclical garbage is no longer collected. - @SymbolName("Kotlin_konan_internal_GC_stop") + @SymbolName("Kotlin_native_internal_GC_stop") external fun stop() // Start garbage collection. Cyclical garbage produced while GC was stopped // cannot be reclaimed, but all new garbage is collected. - @SymbolName("Kotlin_konan_internal_GC_start") + @SymbolName("Kotlin_native_internal_GC_start") external fun start() // GC threshold, controlling how frequenly GC is activated, and how much time GC @@ -60,9 +60,9 @@ object GC { get() = getThreshold() set(value) = setThreshold(value) - @SymbolName("Kotlin_konan_internal_GC_getThreshold") + @SymbolName("Kotlin_native_internal_GC_getThreshold") private external fun getThreshold(): Int - @SymbolName("Kotlin_konan_internal_GC_setThreshold") + @SymbolName("Kotlin_native_internal_GC_setThreshold") private external fun setThreshold(value: Int) } \ No newline at end of file diff --git a/runtime/src/main/kotlin/konan/internal/HexStringParser.kt b/runtime/src/main/kotlin/kotlin/native/internal/HexStringParser.kt similarity index 98% rename from runtime/src/main/kotlin/konan/internal/HexStringParser.kt rename to runtime/src/main/kotlin/kotlin/native/internal/HexStringParser.kt index 74c4914a4b6..db106c7913d 100644 --- a/runtime/src/main/kotlin/konan/internal/HexStringParser.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/HexStringParser.kt @@ -15,14 +15,14 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlin.text.regex.* -@SymbolName("Konan_int_bits_to_float") +@SymbolName("Kotlin_native_int_bits_to_float") private external fun intBitsToFloat(x: Int): Float -@SymbolName("Konan_long_bits_to_double") +@SymbolName("Kotlin_native_long_bits_to_double") private external fun longBitsToDouble(x: Long): Double /* diff --git a/runtime/src/main/kotlin/konan/internal/InteropBoxing.kt b/runtime/src/main/kotlin/kotlin/native/internal/InteropBoxing.kt similarity index 98% rename from runtime/src/main/kotlin/konan/internal/InteropBoxing.kt rename to runtime/src/main/kotlin/kotlin/native/internal/InteropBoxing.kt index 57a9b0747e4..1a46ab7e929 100644 --- a/runtime/src/main/kotlin/konan/internal/InteropBoxing.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/InteropBoxing.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlinx.cinterop.* diff --git a/runtime/src/main/kotlin/konan/internal/Intrinsics.kt b/runtime/src/main/kotlin/kotlin/native/internal/Intrinsics.kt similarity index 98% rename from runtime/src/main/kotlin/konan/internal/Intrinsics.kt rename to runtime/src/main/kotlin/kotlin/native/internal/Intrinsics.kt index 629f8e618e7..8c4b527c59a 100644 --- a/runtime/src/main/kotlin/konan/internal/Intrinsics.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/Intrinsics.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlinx.cinterop.CPointer import kotlinx.cinterop.NativePointed diff --git a/runtime/src/main/kotlin/konan/internal/KClassImpl.kt b/runtime/src/main/kotlin/kotlin/native/internal/KClassImpl.kt similarity index 98% rename from runtime/src/main/kotlin/konan/internal/KClassImpl.kt rename to runtime/src/main/kotlin/kotlin/native/internal/KClassImpl.kt index edd069e62da..b5f4a0888e4 100644 --- a/runtime/src/main/kotlin/konan/internal/KClassImpl.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/KClassImpl.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlin.reflect.KClass diff --git a/runtime/src/main/kotlin/konan/internal/KFunctionImpl.kt b/runtime/src/main/kotlin/kotlin/native/internal/KFunctionImpl.kt similarity index 97% rename from runtime/src/main/kotlin/konan/internal/KFunctionImpl.kt rename to runtime/src/main/kotlin/kotlin/native/internal/KFunctionImpl.kt index cf187bce750..06f98593de2 100644 --- a/runtime/src/main/kotlin/konan/internal/KFunctionImpl.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/KFunctionImpl.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlin.reflect.KFunction diff --git a/runtime/src/main/kotlin/konan/internal/KPropertyImpl.kt b/runtime/src/main/kotlin/kotlin/native/internal/KPropertyImpl.kt similarity index 99% rename from runtime/src/main/kotlin/konan/internal/KPropertyImpl.kt rename to runtime/src/main/kotlin/kotlin/native/internal/KPropertyImpl.kt index 487ddda7b00..a5153d28592 100644 --- a/runtime/src/main/kotlin/konan/internal/KPropertyImpl.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/KPropertyImpl.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlin.reflect.KProperty0 import kotlin.reflect.KProperty1 diff --git a/runtime/src/main/kotlin/konan/internal/KonanCollections.kt b/runtime/src/main/kotlin/kotlin/native/internal/KonanCollections.kt similarity index 96% rename from runtime/src/main/kotlin/konan/internal/KonanCollections.kt rename to runtime/src/main/kotlin/kotlin/native/internal/KonanCollections.kt index 17bf9bd80a4..13c60b526b9 100644 --- a/runtime/src/main/kotlin/konan/internal/KonanCollections.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/KonanCollections.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal internal interface KonanSet : Set { /** diff --git a/runtime/src/main/kotlin/konan/internal/KonanRuntimeTypes.kt b/runtime/src/main/kotlin/kotlin/native/internal/KonanRuntimeTypes.kt similarity index 95% rename from runtime/src/main/kotlin/konan/internal/KonanRuntimeTypes.kt rename to runtime/src/main/kotlin/kotlin/native/internal/KonanRuntimeTypes.kt index e9296c2f6fc..f998a325c99 100644 --- a/runtime/src/main/kotlin/konan/internal/KonanRuntimeTypes.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/KonanRuntimeTypes.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal internal class FunctionReference \ No newline at end of file diff --git a/runtime/src/main/kotlin/konan/internal/NativePtr.kt b/runtime/src/main/kotlin/kotlin/native/internal/NativePtr.kt similarity index 94% rename from runtime/src/main/kotlin/konan/internal/NativePtr.kt rename to runtime/src/main/kotlin/kotlin/native/internal/NativePtr.kt index 2a8a900617d..4932d169176 100644 --- a/runtime/src/main/kotlin/konan/internal/NativePtr.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/NativePtr.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal @Intrinsic external fun getNativeNullPtr(): NativePtr @@ -27,7 +27,7 @@ class NativePtr @PublishedApi internal constructor(private val value: NonNullNat @Intrinsic external fun toLong(): Long - override fun equals(other: Any?) = (other is NativePtr) && konan.internal.areEqualByValue(this, other) + override fun equals(other: Any?) = (other is NativePtr) && kotlin.native.internal.areEqualByValue(this, other) override fun hashCode() = this.toLong().hashCode() diff --git a/runtime/src/main/kotlin/konan/internal/NumberConverter.kt b/runtime/src/main/kotlin/kotlin/native/internal/NumberConverter.kt similarity index 98% rename from runtime/src/main/kotlin/konan/internal/NumberConverter.kt rename to runtime/src/main/kotlin/kotlin/native/internal/NumberConverter.kt index 667d53d595c..8e065e62530 100644 --- a/runtime/src/main/kotlin/konan/internal/NumberConverter.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/NumberConverter.kt @@ -15,13 +15,13 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal -@SymbolName("Konan_NumberConverter_bigIntDigitGeneratorInstImpl") +@SymbolName("Kotlin_native_NumberConverter_bigIntDigitGeneratorInstImpl") private external fun bigIntDigitGeneratorInstImpl(results: IntArray, uArray: IntArray, f: Long, e: Int, isDenormalized: Boolean, mantissaIsZero: Boolean, p: Int) -@SymbolName("Konan_NumberConverter_ceil") +@SymbolName("Kotlin_native_NumberConverter_ceil") private external fun ceil(x: Double): Double class NumberConverter { diff --git a/runtime/src/main/kotlin/konan/internal/ObjCExportUtils.kt b/runtime/src/main/kotlin/kotlin/native/internal/ObjCExportUtils.kt similarity index 96% rename from runtime/src/main/kotlin/konan/internal/ObjCExportUtils.kt rename to runtime/src/main/kotlin/kotlin/native/internal/ObjCExportUtils.kt index fb0773487bc..e63f098ef35 100644 --- a/runtime/src/main/kotlin/konan/internal/ObjCExportUtils.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/ObjCExportUtils.kt @@ -14,9 +14,11 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal -import konan.internal.ExportForCppRuntime +import kotlin.native.internal.ExportForCppRuntime +import kotlin.native.internal.KonanSet +import kotlin.native.internal.ReportUnhandledException /** * This interface denotes the object to be a wrapper for the Objective-C object, @@ -56,7 +58,7 @@ internal class NSMutableArrayAsKMutableList : AbstractMutableList(), ObjCO external override fun set(index: Int, element: Any?): Any? } -internal class NSSetAsKSet : AbstractSet(), konan.internal.KonanSet, ObjCObjectWrapper { +internal class NSSetAsKSet : AbstractSet(), KonanSet, ObjCObjectWrapper { override val size: Int get() = getSize() @@ -235,7 +237,7 @@ internal class NSEnumeratorAsKIterator : AbstractIterator() { @ExportForCppRuntime private fun Kotlin_Set_contains(set: Set, element: Any?): Boolean = set.contains(element) @ExportForCppRuntime private fun Kotlin_Set_getElement(set: Set, element: Any?): Any? = - if (set is konan.internal.KonanSet) { + if (set is KonanSet) { set.getElement(element) } else if (set.contains(element)) { set.first { it == element } @@ -300,7 +302,7 @@ private fun Throwable.isUncheckedException(): Boolean = this is kotlin.Error || private fun Kotlin_ObjCExport_abortIfUnchecked(exception: Throwable) { if (exception.isUncheckedException()) { println(uncheckedExceptionMessage) - konan.internal.ReportUnhandledException(exception) + ReportUnhandledException(exception) kotlin.system.exitProcess(1) } } @@ -315,7 +317,7 @@ private fun trapOnUndeclaredException(exception: Throwable) { "only if method has or inherits @Throws annotation") } - konan.internal.ReportUnhandledException(exception) + ReportUnhandledException(exception) kotlin.system.exitProcess(1) } diff --git a/runtime/src/main/kotlin/konan/internal/Ref.kt b/runtime/src/main/kotlin/kotlin/native/internal/Ref.kt similarity index 95% rename from runtime/src/main/kotlin/konan/internal/Ref.kt rename to runtime/src/main/kotlin/kotlin/native/internal/Ref.kt index a042ad58c79..66c7e4d6894 100644 --- a/runtime/src/main/kotlin/konan/internal/Ref.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/Ref.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal /** * This class is used to allocate closure-captured variables in the heap. diff --git a/runtime/src/main/kotlin/konan/internal/RuntimeUtils.kt b/runtime/src/main/kotlin/kotlin/native/internal/RuntimeUtils.kt similarity index 99% rename from runtime/src/main/kotlin/konan/internal/RuntimeUtils.kt rename to runtime/src/main/kotlin/kotlin/native/internal/RuntimeUtils.kt index 9beba050415..0b78c93ccfa 100644 --- a/runtime/src/main/kotlin/konan/internal/RuntimeUtils.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/RuntimeUtils.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal import kotlin.internal.getProgressionLastElement import kotlin.reflect.KClass diff --git a/runtime/src/main/kotlin/konan/internal/Strings.kt b/runtime/src/main/kotlin/kotlin/native/internal/Strings.kt similarity index 100% rename from runtime/src/main/kotlin/konan/internal/Strings.kt rename to runtime/src/main/kotlin/kotlin/native/internal/Strings.kt diff --git a/runtime/src/main/kotlin/konan/internal/Undefined.kt b/runtime/src/main/kotlin/kotlin/native/internal/Undefined.kt similarity index 90% rename from runtime/src/main/kotlin/konan/internal/Undefined.kt rename to runtime/src/main/kotlin/kotlin/native/internal/Undefined.kt index 43288e67126..d6b5895903f 100644 --- a/runtime/src/main/kotlin/konan/internal/Undefined.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/Undefined.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal /** * Returns undefined value of type `T`. * This method is unsafe and should be used with care. */ -@SymbolName("Kotlin_konan_internal_undefined") +@SymbolName("Kotlin_native_internal_undefined") internal external fun undefined(): T \ No newline at end of file diff --git a/runtime/src/main/kotlin/konan/internal/ValueTypes.kt b/runtime/src/main/kotlin/kotlin/native/internal/ValueTypes.kt similarity index 96% rename from runtime/src/main/kotlin/konan/internal/ValueTypes.kt rename to runtime/src/main/kotlin/kotlin/native/internal/ValueTypes.kt index 559dd79e5bd..cb6b542d18d 100644 --- a/runtime/src/main/kotlin/konan/internal/ValueTypes.kt +++ b/runtime/src/main/kotlin/kotlin/native/internal/ValueTypes.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.internal +package kotlin.native.internal internal class BooleanValue internal class ByteValue diff --git a/runtime/src/main/kotlin/konan/ref/Weak.kt b/runtime/src/main/kotlin/kotlin/native/ref/Weak.kt similarity index 98% rename from runtime/src/main/kotlin/konan/ref/Weak.kt rename to runtime/src/main/kotlin/kotlin/native/ref/Weak.kt index 6d794ef1318..c0e6eec3d06 100644 --- a/runtime/src/main/kotlin/konan/ref/Weak.kt +++ b/runtime/src/main/kotlin/kotlin/native/ref/Weak.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.ref +package kotlin.native.ref /** * Class WeakReference encapsulates weak reference to an object, which could be used to either diff --git a/runtime/src/main/kotlin/konan/ref/WeakPrivate.kt b/runtime/src/main/kotlin/kotlin/native/ref/WeakPrivate.kt similarity index 95% rename from runtime/src/main/kotlin/konan/ref/WeakPrivate.kt rename to runtime/src/main/kotlin/kotlin/native/ref/WeakPrivate.kt index 15f1073e879..0dbdde3419e 100644 --- a/runtime/src/main/kotlin/konan/ref/WeakPrivate.kt +++ b/runtime/src/main/kotlin/kotlin/native/ref/WeakPrivate.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package konan.ref +package kotlin.native.ref import kotlinx.cinterop.COpaquePointer -import konan.internal.ExportForCppRuntime -import konan.internal.NoReorderFields +import kotlin.native.internal.NoReorderFields +import kotlin.native.internal.ExportForCppRuntime /** * Theory of operations: diff --git a/runtime/src/main/kotlin/konan/runtime.kt b/runtime/src/main/kotlin/kotlin/native/runtime.kt similarity index 97% rename from runtime/src/main/kotlin/konan/runtime.kt rename to runtime/src/main/kotlin/kotlin/native/runtime.kt index 17cfed65661..afd8af70fb9 100644 --- a/runtime/src/main/kotlin/konan/runtime.kt +++ b/runtime/src/main/kotlin/kotlin/native/runtime.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package konan +package kotlin.native // Initializes Kotlin runtime for the current thread, if not inited already. @SymbolName("Kotlin_initRuntimeIfNeeded") diff --git a/runtime/src/main/kotlin/konan/test/GTestLogger.kt b/runtime/src/main/kotlin/kotlin/native/test/GTestLogger.kt similarity index 99% rename from runtime/src/main/kotlin/konan/test/GTestLogger.kt rename to runtime/src/main/kotlin/kotlin/native/test/GTestLogger.kt index c1d06c1a200..5d4ad476611 100644 --- a/runtime/src/main/kotlin/konan/test/GTestLogger.kt +++ b/runtime/src/main/kotlin/kotlin/native/test/GTestLogger.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.test +package kotlin.native.test class GTestLogger : TestLoggerWithStatistics() { diff --git a/runtime/src/main/kotlin/konan/test/Launcher.kt b/runtime/src/main/kotlin/kotlin/native/test/Launcher.kt similarity index 97% rename from runtime/src/main/kotlin/konan/test/Launcher.kt rename to runtime/src/main/kotlin/kotlin/native/test/Launcher.kt index 72ac953df39..170714e58c2 100644 --- a/runtime/src/main/kotlin/konan/test/Launcher.kt +++ b/runtime/src/main/kotlin/kotlin/native/test/Launcher.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.test +package kotlin.native.test import kotlin.system.exitProcess diff --git a/runtime/src/main/kotlin/konan/test/TeamCityLogger.kt b/runtime/src/main/kotlin/kotlin/native/test/TeamCityLogger.kt similarity index 98% rename from runtime/src/main/kotlin/konan/test/TeamCityLogger.kt rename to runtime/src/main/kotlin/kotlin/native/test/TeamCityLogger.kt index fc04e5d349e..0ab19abe710 100644 --- a/runtime/src/main/kotlin/konan/test/TeamCityLogger.kt +++ b/runtime/src/main/kotlin/kotlin/native/test/TeamCityLogger.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.test +package kotlin.native.test import kotlin.text.StringBuilder diff --git a/runtime/src/main/kotlin/konan/test/TestListener.kt b/runtime/src/main/kotlin/kotlin/native/test/TestListener.kt similarity index 98% rename from runtime/src/main/kotlin/konan/test/TestListener.kt rename to runtime/src/main/kotlin/kotlin/native/test/TestListener.kt index e0488e6b0ae..c2f2cb009d0 100644 --- a/runtime/src/main/kotlin/konan/test/TestListener.kt +++ b/runtime/src/main/kotlin/kotlin/native/test/TestListener.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.test +package kotlin.native.test interface TestListener { fun startTesting(runner: TestRunner) diff --git a/runtime/src/main/kotlin/konan/test/TestLogger.kt b/runtime/src/main/kotlin/kotlin/native/test/TestLogger.kt similarity index 99% rename from runtime/src/main/kotlin/konan/test/TestLogger.kt rename to runtime/src/main/kotlin/kotlin/native/test/TestLogger.kt index 699fe7cb850..dc153a75444 100644 --- a/runtime/src/main/kotlin/konan/test/TestLogger.kt +++ b/runtime/src/main/kotlin/kotlin/native/test/TestLogger.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.test +package kotlin.native.test interface TestLogger: TestListener { fun logTestList(runner: TestRunner, suites: Collection) diff --git a/runtime/src/main/kotlin/konan/test/TestRunner.kt b/runtime/src/main/kotlin/kotlin/native/test/TestRunner.kt similarity index 99% rename from runtime/src/main/kotlin/konan/test/TestRunner.kt rename to runtime/src/main/kotlin/kotlin/native/test/TestRunner.kt index cf4e175e2d8..e4f005f3b80 100644 --- a/runtime/src/main/kotlin/konan/test/TestRunner.kt +++ b/runtime/src/main/kotlin/kotlin/native/test/TestRunner.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.test +package kotlin.native.test import kotlin.IllegalArgumentException import kotlin.system.getTimeMillis diff --git a/runtime/src/main/kotlin/konan/test/TestStatistics.kt b/runtime/src/main/kotlin/kotlin/native/test/TestStatistics.kt similarity index 98% rename from runtime/src/main/kotlin/konan/test/TestStatistics.kt rename to runtime/src/main/kotlin/kotlin/native/test/TestStatistics.kt index cc61b8c1cdd..4fad74c9f16 100644 --- a/runtime/src/main/kotlin/konan/test/TestStatistics.kt +++ b/runtime/src/main/kotlin/kotlin/native/test/TestStatistics.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.test +package kotlin.native.test interface TestStatistics { val total: Int diff --git a/runtime/src/main/kotlin/konan/test/TestSuite.kt b/runtime/src/main/kotlin/kotlin/native/test/TestSuite.kt similarity index 99% rename from runtime/src/main/kotlin/konan/test/TestSuite.kt rename to runtime/src/main/kotlin/kotlin/native/test/TestSuite.kt index e89ac6086c1..4dd11d3c437 100644 --- a/runtime/src/main/kotlin/konan/test/TestSuite.kt +++ b/runtime/src/main/kotlin/kotlin/native/test/TestSuite.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.test +package kotlin.native.test import kotlin.IllegalArgumentException import kotlin.system.getTimeMillis diff --git a/runtime/src/main/kotlin/konan/worker/Atomics.kt b/runtime/src/main/kotlin/kotlin/native/worker/Atomics.kt similarity index 97% rename from runtime/src/main/kotlin/konan/worker/Atomics.kt rename to runtime/src/main/kotlin/kotlin/native/worker/Atomics.kt index ac3265e54cd..c5e6f8328a0 100644 --- a/runtime/src/main/kotlin/konan/worker/Atomics.kt +++ b/runtime/src/main/kotlin/kotlin/native/worker/Atomics.kt @@ -14,11 +14,11 @@ * limitations under the License. */ -package konan.worker +package kotlin.native.worker -import konan.internal.Frozen -import konan.internal.NoReorderFields -import konan.SymbolName +import kotlin.native.internal.Frozen +import kotlin.native.internal.NoReorderFields +import kotlin.native.SymbolName import kotlinx.cinterop.NativePtr @Frozen diff --git a/runtime/src/main/kotlin/konan/worker/Freezing.kt b/runtime/src/main/kotlin/kotlin/native/worker/Freezing.kt similarity index 96% rename from runtime/src/main/kotlin/konan/worker/Freezing.kt rename to runtime/src/main/kotlin/kotlin/native/worker/Freezing.kt index 5f5932a0d40..7012c011236 100644 --- a/runtime/src/main/kotlin/konan/worker/Freezing.kt +++ b/runtime/src/main/kotlin/kotlin/native/worker/Freezing.kt @@ -14,9 +14,9 @@ * limitations under the License. */ -package konan.worker +package kotlin.native.worker -import konan.internal.ExportForCppRuntime +import kotlin.native.internal.ExportForCppRuntime /** * Exception thrown whenever freezing is not possible. diff --git a/runtime/src/main/kotlin/konan/worker/Future.kt b/runtime/src/main/kotlin/kotlin/native/worker/Future.kt similarity index 96% rename from runtime/src/main/kotlin/konan/worker/Future.kt rename to runtime/src/main/kotlin/kotlin/native/worker/Future.kt index 515a1939570..fb2140f7410 100644 --- a/runtime/src/main/kotlin/konan/worker/Future.kt +++ b/runtime/src/main/kotlin/kotlin/native/worker/Future.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package konan.worker +package kotlin.native.worker -import konan.SymbolName -import konan.internal.ExportForCppRuntime +import kotlin.native.SymbolName +import kotlin.native.internal.ExportForCppRuntime /** * Unique identifier of the future. Futures can be used from other workers. diff --git a/runtime/src/main/kotlin/konan/worker/ObjectTransfer.kt b/runtime/src/main/kotlin/kotlin/native/worker/ObjectTransfer.kt similarity index 99% rename from runtime/src/main/kotlin/konan/worker/ObjectTransfer.kt rename to runtime/src/main/kotlin/kotlin/native/worker/ObjectTransfer.kt index f848ab6e58a..38f6f877f26 100644 --- a/runtime/src/main/kotlin/konan/worker/ObjectTransfer.kt +++ b/runtime/src/main/kotlin/kotlin/native/worker/ObjectTransfer.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package konan.worker +package kotlin.native.worker import kotlinx.cinterop.* diff --git a/runtime/src/main/kotlin/konan/worker/Worker.kt b/runtime/src/main/kotlin/kotlin/native/worker/Worker.kt similarity index 96% rename from runtime/src/main/kotlin/konan/worker/Worker.kt rename to runtime/src/main/kotlin/kotlin/native/worker/Worker.kt index 17a7bde7e2a..c3a29b0246a 100644 --- a/runtime/src/main/kotlin/konan/worker/Worker.kt +++ b/runtime/src/main/kotlin/kotlin/native/worker/Worker.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package konan.worker +package kotlin.native.worker -import konan.SymbolName -import konan.internal.ExportForCppRuntime +import kotlin.native.SymbolName +import kotlin.native.internal.ExportForCppRuntime import kotlinx.cinterop.* /** @@ -81,7 +81,7 @@ class Worker(val id: WorkerId) { fun startWorker(): Worker = Worker(startInternal()) // Private APIs. -@konan.internal.ExportForCompiler +@kotlin.native.internal.ExportForCompiler internal fun scheduleImpl(worker: Worker, mode: TransferMode, producer: () -> Any?, job: CPointer>): Future = Future(scheduleInternal(worker.id, mode.value, producer, job)) diff --git a/runtime/src/main/kotlin/kotlin/random/Random.kt b/runtime/src/main/kotlin/kotlin/random/Random.kt index 5e75769c446..7201eb9e5ed 100644 --- a/runtime/src/main/kotlin/kotlin/random/Random.kt +++ b/runtime/src/main/kotlin/kotlin/random/Random.kt @@ -15,7 +15,7 @@ */ package kotlin.random -import konan.worker.AtomicLong +import kotlin.native.worker.AtomicLong import kotlin.system.getTimeNanos abstract class Random { diff --git a/runtime/src/main/kotlin/kotlin/reflect/KProperty.kt b/runtime/src/main/kotlin/kotlin/reflect/KProperty.kt index 571f9181755..ed6bdd626c9 100644 --- a/runtime/src/main/kotlin/kotlin/reflect/KProperty.kt +++ b/runtime/src/main/kotlin/kotlin/reflect/KProperty.kt @@ -16,6 +16,8 @@ package kotlin.reflect +import kotlin.native.* + /** * Represents a property, such as a named `val` or `var` declaration. * Instances of this class are obtainable by the `::` operator. diff --git a/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt b/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt index 5c3eccd985d..bc5d7416e30 100644 --- a/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt +++ b/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt @@ -16,7 +16,7 @@ package kotlin.text -import konan.internal.FloatingPointParser +import kotlin.native.internal.FloatingPointParser /** * Returns a string representation of this [Byte] value in the specified [radix]. diff --git a/runtime/src/main/kotlin/kotlin/text/regex/AbstractCharClass.kt b/runtime/src/main/kotlin/kotlin/text/regex/AbstractCharClass.kt index 3717c440f15..64594df1ee5 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/AbstractCharClass.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/AbstractCharClass.kt @@ -33,8 +33,9 @@ package kotlin.text.regex +import kotlin.native.worker.AtomicReference import kotlin.collections.associate -import konan.worker.freeze +import kotlin.native.worker.freeze /** @@ -98,7 +99,7 @@ internal abstract class AbstractCharClass : SpecialToken() { get() = this - private val surrogates_ = konan.worker.AtomicReference() + private val surrogates_ = AtomicReference() val surrogates: AbstractCharClass get() { surrogates_.get()?.let { @@ -120,7 +121,7 @@ internal abstract class AbstractCharClass : SpecialToken() { } - private val withoutSurrogates_ = konan.worker.AtomicReference() + private val withoutSurrogates_ = AtomicReference() val withoutSurrogates: AbstractCharClass get() { withoutSurrogates_.get()?.let { @@ -572,8 +573,8 @@ internal abstract class AbstractCharClass : SpecialToken() { PF("Pf", { CachedCategory(CharCategory.FINAL_QUOTE_PUNCTUATION.value, false) }) } - private val classCache = Array>(CharClasses.values().size, { - konan.worker.AtomicReference() + private val classCache = Array>(CharClasses.values().size, { + AtomicReference() }) private val classCacheMap = CharClasses.values().associate { it -> it.regexName to it } diff --git a/samples/globalState/src/main/kotlin/Global.kt b/samples/globalState/src/main/kotlin/Global.kt index 0917244dd67..2c7f48a9ff8 100644 --- a/samples/globalState/src/main/kotlin/Global.kt +++ b/samples/globalState/src/main/kotlin/Global.kt @@ -17,7 +17,7 @@ import global.* import kotlinx.cinterop.* import platform.posix.* -import konan.worker.* +import kotlin.native.worker.* inline fun Int.ensureUnixCallResult(op: String, predicate: (Int) -> Boolean = { x -> x == 0} ): Int { if (!predicate(this)) { @@ -49,7 +49,7 @@ fun main(args: Array) { sharedData.f = 0.5f sharedData.string = "Hello Kotlin!".cstr.getPointer(arena) // Here we create detached mutable object, which could be later reattached by another thread. - sharedData.kotlinObject = konan.worker.detachObjectGraph { + sharedData.kotlinObject = kotlin.native.worker.detachObjectGraph { SharedData("A string", 42, SharedDataMember(2.39)) } // Here we create shared frozen object reference, @@ -66,12 +66,12 @@ fun main(args: Array) { argC -> initRuntimeIfNeeded() dumpShared("thread2") - val kotlinObject = konan.worker.attachObjectGraph(sharedData.kotlinObject) - val arg = konan.worker.attachObjectGraph(argC) + val kotlinObject = kotlin.native.worker.attachObjectGraph(sharedData.kotlinObject) + val arg = kotlin.native.worker.attachObjectGraph(argC) println("thread arg is $arg Kotlin object is $kotlinObject frozen is $globalObject") // Workaround for compiler issue. null as COpaquePointer? - }, konan.worker.detachObjectGraph { SharedDataMember(3.14)} ).ensureUnixCallResult("pthread_create") + }, kotlin.native.worker.detachObjectGraph { SharedDataMember(3.14)} ).ensureUnixCallResult("pthread_create") pthread_join(thread.value, null).ensureUnixCallResult("pthread_join") } diff --git a/samples/objc/src/main/kotlin/Window.kt b/samples/objc/src/main/kotlin/Window.kt index d5587d82721..fc19eb3d164 100644 --- a/samples/objc/src/main/kotlin/Window.kt +++ b/samples/objc/src/main/kotlin/Window.kt @@ -30,12 +30,12 @@ private class Controller : NSObject() { @ObjCAction fun onClick() { // Execute some async action on button click. - dispatch_async_f(asyncQueue, konan.worker.detachObjectGraph { + dispatch_async_f(asyncQueue, kotlin.native.worker.detachObjectGraph { Data(clock_gettime_nsec_np(CLOCK_REALTIME)) }, staticCFunction { it -> initRuntimeIfNeeded() - val data = konan.worker.attachObjectGraph(it) + val data = kotlin.native.worker.attachObjectGraph(it) println("in async: $data") }) } diff --git a/samples/videoplayer/src/main/kotlin/DecoderWorker.kt b/samples/videoplayer/src/main/kotlin/DecoderWorker.kt index 46b90cc8441..2b60db4afbd 100644 --- a/samples/videoplayer/src/main/kotlin/DecoderWorker.kt +++ b/samples/videoplayer/src/main/kotlin/DecoderWorker.kt @@ -16,7 +16,7 @@ import ffmpeg.* import kotlinx.cinterop.* -import konan.worker.* +import kotlin.native.worker.* import platform.posix.memcpy // This global variable only set to != null value in the decoding worker. @@ -329,7 +329,7 @@ class DecoderWorker : Disposable { // All the real state must be stored on the worker's side. private val worker: Worker - constructor() { worker = konan.worker.startWorker() } + constructor() { worker = kotlin.native.worker.startWorker() } constructor(id: WorkerId) { worker = Worker(id) } override fun dispose() { diff --git a/samples/videoplayer/src/main/kotlin/SDLAudio.kt b/samples/videoplayer/src/main/kotlin/SDLAudio.kt index fb4ca2ad8ed..3ed95eaeae1 100644 --- a/samples/videoplayer/src/main/kotlin/SDLAudio.kt +++ b/samples/videoplayer/src/main/kotlin/SDLAudio.kt @@ -80,7 +80,7 @@ private var decoder: DecoderWorker? = null private fun audioCallback(userdata: COpaquePointer?, buffer: CPointer?, length: Int) { // This handler will be invoked in the audio thread, so reinit runtime. - konan.initRuntimeIfNeeded() + kotlin.native.initRuntimeIfNeeded() val decoder = decoder ?: DecoderWorker(userdata!!.reinterpret().pointed.value).also { decoder = it } var outPosition = 0 diff --git a/samples/workers/src/main/kotlin/Workers.kt b/samples/workers/src/main/kotlin/Workers.kt index cce4be4d6f8..7121b8d03a7 100644 --- a/samples/workers/src/main/kotlin/Workers.kt +++ b/samples/workers/src/main/kotlin/Workers.kt @@ -1,4 +1,4 @@ -import konan.worker.* +import kotlin.native.worker.* data class WorkerArgument(val intParam: Int, val stringParam: String) data class WorkerResult(val intResult: Int, val stringResult: String)