[stdlib and samples][rename] konan -> kotlin.native
This commit is contained in:
+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() {
|
||||
|
||||
Reference in New Issue
Block a user