[stdlib and samples][rename] konan -> kotlin.native
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 <R> CPointer<CFunction<() -> R>>.invoke(): R
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
package kotlinx.cinterop
|
||||
import kotlin.native.*
|
||||
|
||||
@SymbolName("Kotlin_Interop_createStablePointer")
|
||||
internal external fun createStablePointer(any: Any): COpaquePointer
|
||||
|
||||
@@ -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<NativePtr, NonNullNativePtr>()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package kotlinx.cinterop
|
||||
|
||||
import konan.internal.Intrinsic
|
||||
import kotlin.native.internal.Intrinsic
|
||||
|
||||
internal fun decodeFromUtf8(bytes: ByteArray): String = bytes.stringFromUtf8()
|
||||
|
||||
|
||||
@@ -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<T : ObjCObject> : 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 : ObjCObjectBase> 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 <T : Any?> ObjCNotImplementedVar<T>.value: T
|
||||
typealias ObjCStringVarOf<T> = ObjCNotImplementedVar<T>
|
||||
typealias ObjCBlockVar<T> = ObjCNotImplementedVar<T>
|
||||
|
||||
@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 <T : ObjCObject> 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
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
package kotlinx.cinterop
|
||||
import kotlin.native.*
|
||||
|
||||
data class Pinned<out T : Any> internal constructor(private val stablePtr: COpaquePointer) {
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
package kotlinx.cinterop
|
||||
import kotlin.native.*
|
||||
|
||||
private const val MAX_ARGUMENT_SIZE = 8
|
||||
|
||||
|
||||
+1
-1
@@ -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)
|
||||
)
|
||||
|
||||
+1
-1
@@ -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;")
|
||||
|
||||
+1
-1
@@ -903,7 +903,7 @@ class StubGenerator(
|
||||
out("")
|
||||
}
|
||||
if (platform == KotlinPlatform.NATIVE) {
|
||||
out("import konan.SymbolName")
|
||||
out("import kotlin.native.SymbolName")
|
||||
}
|
||||
out("import kotlinx.cinterop.*")
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+3
-3
@@ -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<IrClass, ClassVtablesBuilder>()
|
||||
|
||||
|
||||
+8
-8
@@ -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)
|
||||
|
||||
;
|
||||
|
||||
|
||||
+1
-1
@@ -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()
|
||||
|
||||
+3
-3
@@ -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<FunctionDescriptor> =
|
||||
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)
|
||||
|
||||
+5
-4
@@ -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")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
|
||||
+4
-4
@@ -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<Declaration
|
||||
// since externals don't have IR bodies.
|
||||
// Enforce inlining of constructors annotated with @InlineConstructor.
|
||||
|
||||
private val inlineConstructor = FqName("konan.internal.InlineConstructor")
|
||||
private val inlineConstructor = FqName("kotlin.native.internal.InlineConstructor")
|
||||
|
||||
internal val FunctionDescriptor.needsInlining: Boolean
|
||||
get() {
|
||||
|
||||
+5
-5
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.backend.common.COROUTINE_SUSPENDED_NAME
|
||||
import org.jetbrains.kotlin.backend.common.ir.Ir
|
||||
import org.jetbrains.kotlin.backend.common.ir.Symbols
|
||||
import org.jetbrains.kotlin.backend.konan.*
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.konanInternal
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.kotlinNativeInternal
|
||||
import org.jetbrains.kotlin.backend.konan.llvm.findMainEntryPoint
|
||||
import org.jetbrains.kotlin.backend.konan.lower.TestProcessor
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
@@ -173,7 +173,7 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable, val
|
||||
symbolTable.referenceSimpleFunction(context.interopBuiltIns.CreateNSStringFromKString)
|
||||
|
||||
val objCExportTrapOnUndeclaredException =
|
||||
symbolTable.referenceSimpleFunction(context.builtIns.konanInternal.getContributedFunctions(
|
||||
symbolTable.referenceSimpleFunction(context.builtIns.kotlinNativeInternal.getContributedFunctions(
|
||||
Name.identifier("trapOnUndeclaredException"),
|
||||
NoLookupLocation.FROM_BACKEND
|
||||
).single())
|
||||
@@ -191,7 +191,7 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable, val
|
||||
}
|
||||
|
||||
val immutableBinaryBlob = symbolTable.referenceClass(
|
||||
builtInsPackage("konan").getContributedClassifier(
|
||||
builtInsPackage("kotlin", "native").getContributedClassifier(
|
||||
Name.identifier("ImmutableBinaryBlob"), NoLookupLocation.FROM_BACKEND
|
||||
) as ClassDescriptor
|
||||
)
|
||||
@@ -301,7 +301,7 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable, val
|
||||
context.getInternalFunctions("initInstance").single())
|
||||
|
||||
val freeze = symbolTable.referenceSimpleFunction(
|
||||
builtInsPackage("konan", "worker").getContributedFunctions(Name.identifier("freeze"), NoLookupLocation.FROM_BACKEND).single())
|
||||
builtInsPackage("kotlin", "native", "worker").getContributedFunctions(Name.identifier("freeze"), NoLookupLocation.FROM_BACKEND).single())
|
||||
|
||||
val println = symbolTable.referenceSimpleFunction(
|
||||
builtInsPackage("kotlin", "io").getContributedFunctions(Name.identifier("println"), NoLookupLocation.FROM_BACKEND)
|
||||
@@ -363,7 +363,7 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable, val
|
||||
symbolTable.referenceClass(context.getInternalClass(name))
|
||||
|
||||
private fun getKonanTestClass(className: String) = symbolTable.referenceClass(
|
||||
builtInsPackage("konan", "test").getContributedClassifier(
|
||||
builtInsPackage("kotlin", "native", "test").getContributedClassifier(
|
||||
Name.identifier(className), NoLookupLocation.FROM_BACKEND
|
||||
) as ClassDescriptor)
|
||||
|
||||
|
||||
+4
-4
@@ -116,13 +116,13 @@ internal tailrec fun DeclarationDescriptor.isExported(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
private val symbolNameAnnotation = FqName("konan.SymbolName")
|
||||
private val symbolNameAnnotation = FqName("kotlin.native.SymbolName")
|
||||
|
||||
private val exportForCppRuntimeAnnotation = FqName("konan.internal.ExportForCppRuntime")
|
||||
private val exportForCppRuntimeAnnotation = FqName("kotlin.native.internal.ExportForCppRuntime")
|
||||
|
||||
private val cnameAnnotation = FqName("konan.internal.CName")
|
||||
private val cnameAnnotation = FqName("kotlin.native.internal.CName")
|
||||
|
||||
private val exportForCompilerAnnotation = FqName("konan.internal.ExportForCompiler")
|
||||
private val exportForCompilerAnnotation = FqName("kotlin.native.internal.ExportForCompiler")
|
||||
|
||||
private val publishedApiAnnotation = FqName("kotlin.PublishedApi")
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ internal fun findMainEntryPoint(context: Context): FunctionDescriptor? {
|
||||
}
|
||||
|
||||
private val defaultEntryName = "main"
|
||||
private val testEntryName = "konan.test.main"
|
||||
private val testEntryName = "kotlin.native.test.main"
|
||||
|
||||
private val defaultEntryPackage = FqName.ROOT
|
||||
|
||||
|
||||
+4
-4
@@ -46,7 +46,7 @@ import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
||||
|
||||
private val threadLocalAnnotationFqName = FqName("konan.ThreadLocal")
|
||||
private val threadLocalAnnotationFqName = FqName("kotlin.native.ThreadLocal")
|
||||
|
||||
val IrClassSymbol.objectIsShared get() =
|
||||
!descriptor.annotations.hasAnnotation(threadLocalAnnotationFqName)
|
||||
@@ -2098,7 +2098,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
|
||||
val name = descriptor.fqNameUnsafe.asString()
|
||||
|
||||
when (name) {
|
||||
"konan.internal.areEqualByValue" -> {
|
||||
"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<IrE
|
||||
}
|
||||
}
|
||||
}
|
||||
"konan.internal.ieee754Equals" -> {
|
||||
"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<IrE
|
||||
return functionGenerationContext.fcmpEq(arg0, arg1)
|
||||
|
||||
}
|
||||
"konan.internal.getContinuation" -> return getContinuation()
|
||||
"kotlin.native.internal.getContinuation" -> return getContinuation()
|
||||
}
|
||||
|
||||
val interop = context.interopBuiltIns
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ private fun Context.getDeclaredFields(classDescriptor: ClassDescriptor): List<Ir
|
||||
// TODO: hack over missed parents in deserialized fields/property declarations.
|
||||
fields.forEach{it.parent = irClass}
|
||||
|
||||
if (classDescriptor.hasAnnotation(FqName.fromSegments(listOf("konan", "internal", "NoReorderFields"))))
|
||||
if (classDescriptor.hasAnnotation(FqName.fromSegments(listOf("kotlin", "native", "internal", "NoReorderFields"))))
|
||||
return fields
|
||||
|
||||
return fields.sortedBy {
|
||||
|
||||
+2
-2
@@ -98,7 +98,7 @@ internal class RTTIGenerator(override val context: Context) : ContextUtils {
|
||||
}
|
||||
|
||||
private fun exportTypeInfoIfRequired(classDesc: ClassDescriptor, typeInfoGlobal: LLVMValueRef?) {
|
||||
val annot = classDesc.descriptor.annotations.findAnnotation(FqName("konan.ExportTypeInfo"))
|
||||
val annot = classDesc.descriptor.annotations.findAnnotation(FqName("kotlin.native.ExportTypeInfo"))
|
||||
if (annot != null) {
|
||||
val name = getStringValue(annot)!!
|
||||
// TODO: use LLVMAddAlias?
|
||||
@@ -118,7 +118,7 @@ internal class RTTIGenerator(override val context: Context) : ContextUtils {
|
||||
"kotlin.DoubleArray" to LLVMDoubleType()!!,
|
||||
"kotlin.BooleanArray" to LLVMInt8Type()!!,
|
||||
"kotlin.String" to LLVMInt16Type()!!,
|
||||
"konan.ImmutableBinaryBlob" to LLVMInt8Type()!!
|
||||
"kotlin.native.ImmutableBinaryBlob" to LLVMInt8Type()!!
|
||||
)
|
||||
|
||||
// Keep in sync with Konan_RuntimeType.
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.*
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
private val annotationName = FqName("konan.Used")
|
||||
private val annotationName = FqName("kotlin.native.Used")
|
||||
|
||||
internal val FunctionDescriptor.usedAnnotation: Boolean
|
||||
get() {
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ internal class CallableReferenceLowering(val context: Context): FileLoweringPass
|
||||
val argumentDescriptor = descriptor.valueParameters.singleOrNull {
|
||||
cur.getValueArgument(it.index) == argument
|
||||
}
|
||||
if (argumentDescriptor != null && argumentDescriptor.annotations.findAnnotation(FqName("konan.VolatileLambda")) != null) {
|
||||
if (argumentDescriptor != null && argumentDescriptor.annotations.findAnnotation(FqName("kotlin.native.VolatileLambda")) != null) {
|
||||
return expression
|
||||
}
|
||||
break
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoidW
|
||||
override fun visitElement(element: IrElement) = element.accept(this, null)
|
||||
}
|
||||
|
||||
private val inlineConstructor = FqName("konan.internal.InlineConstructor")
|
||||
private val inlineConstructor = FqName("kotlin.native.internal.InlineConstructor")
|
||||
private val FunctionDescriptor.isInlineConstructor get() = annotations.hasAnnotation(inlineConstructor)
|
||||
|
||||
//-----------------------------------------------------------------------------//
|
||||
|
||||
+1
-1
@@ -635,7 +635,7 @@ internal class InteropLoweringPart1(val context: Context) : IrBuildingTransforme
|
||||
// Special case: bridge from Objective-C method implementation template to Kotlin method;
|
||||
// handled in CodeGeneratorVisitor.callVirtual.
|
||||
val useKotlinDispatch = isInteropStubsFile &&
|
||||
builder.scope.scopeOwner.annotations.hasAnnotation(FqName("konan.internal.ExportForCppRuntime"))
|
||||
builder.scope.scopeOwner.annotations.hasAnnotation(FqName("kotlin.native.internal.ExportForCppRuntime"))
|
||||
|
||||
if (!useKotlinDispatch) {
|
||||
val arguments = descriptor.valueParameters.map { expression.getValueArgument(it)!! }
|
||||
|
||||
+1
-1
@@ -456,7 +456,7 @@ internal object DataFlowIR {
|
||||
|
||||
private val NAME_ESCAPES = Name.identifier("Escapes")
|
||||
private val NAME_POINTS_TO = Name.identifier("PointsTo")
|
||||
private val FQ_NAME_KONAN = FqName.fromSegments(listOf("konan"))
|
||||
private val FQ_NAME_KONAN = FqName.fromSegments(listOf("kotlin", "native"))
|
||||
|
||||
private val FQ_NAME_ESCAPES = FQ_NAME_KONAN.child(NAME_ESCAPES)
|
||||
private val FQ_NAME_POINTS_TO = FQ_NAME_KONAN.child(NAME_POINTS_TO)
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.*
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
|
||||
private val konanInternalPackageName = FqName("konan.internal")
|
||||
private val konanInternalPackageName = FqName("kotlin.native.internal")
|
||||
private val fakeCapturedTypeClassName = Name.identifier("FAKE_CAPTURED_TYPE_CLASS")
|
||||
|
||||
internal fun createFakeClass(packageName: FqName, className: Name)
|
||||
|
||||
+4
-4
@@ -162,13 +162,13 @@ internal tailrec fun DeclarationDescriptor.isExported(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
private val symbolNameAnnotation = FqName("konan.SymbolName")
|
||||
private val symbolNameAnnotation = FqName("kotlin.native.SymbolName")
|
||||
|
||||
private val exportForCppRuntimeAnnotation = FqName("konan.internal.ExportForCppRuntime")
|
||||
private val exportForCppRuntimeAnnotation = FqName("kotlin.native.internal.ExportForCppRuntime")
|
||||
|
||||
private val cnameAnnotation = FqName("konan.internal.CName")
|
||||
private val cnameAnnotation = FqName("kotlin.native.internal.CName")
|
||||
|
||||
private val exportForCompilerAnnotation = FqName("konan.internal.ExportForCompiler")
|
||||
private val exportForCompilerAnnotation = FqName("kotlin.native.internal.ExportForCompiler")
|
||||
|
||||
private val publishedApiAnnotation = FqName("kotlin.PublishedApi")
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package codegen.enum.isFrozen
|
||||
|
||||
import kotlin.test.*
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
enum class Zzz(val zzz: String) {
|
||||
Z1("z1"),
|
||||
|
||||
@@ -5,7 +5,7 @@ import kotlin.test.*
|
||||
/**
|
||||
* Test fails with code generation:
|
||||
* Call parameter type does not match function signature!
|
||||
* %5 = invoke %struct.ObjHeader* @"kfun:konan.internal.boxInt(kotlin.Int)"(i32 1, %struct.ObjHeader** %4)
|
||||
* %5 = invoke %struct.ObjHeader* @"kfun:kotlin.native.internal.boxInt(kotlin.Int)"(i32 1, %struct.ObjHeader** %4)
|
||||
* to label %label_ unwind label %cleanup_landingpad
|
||||
* i32 invoke void @"kfun:foo$default(kotlin.Int;kotlin.Int;kotlin.Int)"(%struct.ObjHeader* %5, i32 0, i32 2)
|
||||
* to label %label_1 unwind label %cleanup_landingpad
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ var A.w: Int
|
||||
v = c + 10
|
||||
}
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object F {
|
||||
var u = 0
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import kotlin.reflect.KProperty
|
||||
|
||||
var result: String by Delegate
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object Delegate {
|
||||
var value = "lol"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class Outer {
|
||||
}
|
||||
}
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object {
|
||||
public var s = "fail"
|
||||
private set
|
||||
|
||||
@@ -7,7 +7,7 @@ class Delegate<T>(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))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object Test {
|
||||
var z = "0"
|
||||
var l = 0L
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object O {
|
||||
var equalsCalled: Boolean = false
|
||||
get(): Boolean {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object A {
|
||||
var x = 0
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ open class BaseClass {
|
||||
get() = this
|
||||
}
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object C: BaseClass(), I<String> {
|
||||
fun f(s: Int) = 1
|
||||
fun f(s: String) = 2
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ open class BaseClass {
|
||||
}
|
||||
|
||||
class Class {
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object C: BaseClass(), I<String> {
|
||||
fun f(s: Int) = 1
|
||||
fun f(s: String) = 2
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// See KT-14999
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object Obj {
|
||||
var key = ""
|
||||
var value = ""
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class Test {
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object {
|
||||
|
||||
public val prop1 : Int = 10
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class TestObject()
|
||||
{
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object {
|
||||
var prop: Int = 1
|
||||
get() = field++
|
||||
|
||||
@@ -2,7 +2,7 @@ class CallbackBlock {}
|
||||
|
||||
public class Foo
|
||||
{
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object {
|
||||
private var bar = 0
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo() {
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object {
|
||||
val bar = "OK";
|
||||
var boo = "FAIL";
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -2,7 +2,7 @@ class App {
|
||||
fun init() {
|
||||
s = "OK"
|
||||
}
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object {
|
||||
var s: String = "Fail"
|
||||
private set
|
||||
|
||||
@@ -8,7 +8,7 @@ public class A {
|
||||
return str
|
||||
}
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
private companion object {
|
||||
private lateinit var str: String
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class Foo {
|
||||
}
|
||||
}
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object Bar {
|
||||
lateinit var p: String
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
import kotlin.reflect.KProperty
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object Delegate {
|
||||
lateinit var prop: KProperty<*>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class A {
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object {
|
||||
private var r: Int = 1;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
object A {
|
||||
private var r: Int = 1;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
@konan.ThreadLocal
|
||||
@kotlin.native.ThreadLocal
|
||||
companion object {
|
||||
private val s: String
|
||||
private var s2: String
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import kotlinx.cinterop.*
|
||||
import objcSmoke.*
|
||||
import konan.ref.*
|
||||
import kotlin.native.ref.*
|
||||
import kotlin.test.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.*
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun main(args: Array<String>) {
|
||||
konan.internal.GC.collect()
|
||||
kotlin.native.internal.GC.collect()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package runtime.memory.weak0
|
||||
|
||||
import kotlin.test.*
|
||||
import konan.ref.*
|
||||
import kotlin.native.ref.*
|
||||
|
||||
data class Data(val s: String)
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.atomic0
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
fun test1(workers: Array<Worker>) {
|
||||
val atomic = AtomicInt(15)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package runtime.workers.enum_identity
|
||||
|
||||
import kotlin.test.*
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
enum class A {
|
||||
A, B
|
||||
|
||||
@@ -18,7 +18,7 @@ package runtime.workers.freeze0
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
data class SharedDataMember(val double: Double)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package runtime.workers.freeze2
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
data class Data(var int: Int)
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.worker0
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
@Test fun runTest() {
|
||||
val worker = startWorker()
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.worker1
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
@Test fun runTest() {
|
||||
val COUNT = 5
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.worker4
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
@Test fun runTest() {
|
||||
val worker = startWorker()
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.worker5
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
@Test fun runTest() {
|
||||
val worker = startWorker()
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.worker6
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
@Test fun runTest() {
|
||||
val worker = startWorker()
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.worker7
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
@Test fun runTest() {
|
||||
val worker = startWorker()
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.worker8
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
data class SharedDataMember(val double: Double)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package runtime.workers.worker9
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import konan.worker.*
|
||||
import kotlin.native.worker.*
|
||||
|
||||
@Test fun runTest() {
|
||||
withLock { println("zzz") }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package kotlin.test.tests
|
||||
|
||||
import kotlin.test.*
|
||||
import konan.test.*
|
||||
import kotlin.native.test.*
|
||||
|
||||
|
||||
@Ignore
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package kotlin.test.tests
|
||||
|
||||
import kotlin.test.*
|
||||
import konan.test.*
|
||||
import kotlin.native.test.*
|
||||
|
||||
@Test
|
||||
fun test() {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import org.jetbrains.kotlin.storage.StorageManager
|
||||
object KonanPlatform : TargetPlatform("Konan") {
|
||||
|
||||
override fun computePlatformSpecificDefaultImports(storageManager: StorageManager, result: MutableList<ImportPath>) {
|
||||
result.add(ImportPath.fromString("konan.*"))
|
||||
result.add(ImportPath.fromString("kotlin.native.*"))
|
||||
}
|
||||
|
||||
override val multiTargetPlatform = MultiTargetPlatform.Specific(platformName)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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<ContainerHeaderList>();
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<Boolean> {
|
||||
public final class Boolean private constructor(private val value: kotlin.native.internal.BooleanValue) : Comparable<Boolean> {
|
||||
/**
|
||||
* 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"
|
||||
|
||||
|
||||
@@ -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<Char> {
|
||||
public final class Char private constructor(private val value: kotlin.native.internal.ShortValue) : Comparable<Char> {
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
|
||||
@@ -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<Byte> {
|
||||
public final class Byte private constructor(private val value: kotlin.native.internal.ByteValue) : Number(), Comparable<Byte> {
|
||||
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<Short> {
|
||||
public final class Short private constructor(private val value: kotlin.native.internal.ShortValue) : Number(), Comparable<Short> {
|
||||
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<Int> {
|
||||
public final class Int private constructor(private val value: kotlin.native.internal.IntValue) : Number(), Comparable<Int> {
|
||||
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<Long> {
|
||||
public final class Long private constructor(private val value: kotlin.native.internal.LongValue) : Number(), Comparable<Long> {
|
||||
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<Float> {
|
||||
public final class Float private constructor(private val value: kotlin.native.internal.FloatValue) : Number(), Comparable<Float> {
|
||||
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<Double> {
|
||||
public final class Double private constructor(private val value: kotlin.native.internal.DoubleValue) : Number(), Comparable<Double> {
|
||||
companion object {
|
||||
/**
|
||||
* A constant holding the smallest *positive* nonzero value of Double.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package kotlin
|
||||
|
||||
@ExportTypeInfo("theStringTypeInfo")
|
||||
@konan.internal.Frozen
|
||||
@kotlin.native.internal.Frozen
|
||||
public final class String : Comparable<String>, CharSequence {
|
||||
public companion object {
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user