[K/N] Deprecate SharedImmutable annotation #KT-57837

As a part of efforts to stabilize Native stdlib.
This commit is contained in:
Abduqodiri Qurbonzoda
2023-06-16 19:20:11 +03:00
committed by Space Team
parent 0cfb80144a
commit 4ae19b2b44
31 changed files with 11 additions and 63 deletions
@@ -9,5 +9,5 @@ import kotlin.native.concurrent.*
@JsName("")
public fun test() {}
@SharedImmutable
@ThreadLocal
private val EmptyArray: Array<Int> = arrayOf()
@@ -1,4 +1,4 @@
package
@kotlin.native.concurrent.SharedImmutable private val EmptyArray: kotlin.Array<kotlin.Int>
@kotlin.native.concurrent.ThreadLocal private val EmptyArray: kotlin.Array<kotlin.Int>
@kotlin.js.JsName(name = "") public fun test(): kotlin.Unit
@@ -14,7 +14,6 @@ import kotlin.native.concurrent.*
class Z(val x: Int)
@SharedImmutable
val z1 = Z(42)
val z2 = Z(x.s.length)
@@ -9,7 +9,6 @@ package runtime.concurrent.worker_bound_reference0
import kotlin.test.*
import kotlin.native.concurrent.*
import kotlin.native.concurrent.SharedImmutable
import kotlin.native.*
import kotlin.native.ref.WeakReference
import kotlin.native.runtime.GC
@@ -17,7 +16,6 @@ import kotlin.text.Regex
class A(var a: Int)
@SharedImmutable
val global1: WorkerBoundReference<A> = WorkerBoundReference(A(3))
@Test
@@ -36,7 +34,6 @@ fun testGlobal() {
worker.requestTermination().result
}
@SharedImmutable
val global2: WorkerBoundReference<A> = WorkerBoundReference(A(3))
@Test
@@ -67,7 +64,6 @@ fun testGlobalAccessOnWorker() {
worker.requestTermination().result
}
@SharedImmutable
val global3: WorkerBoundReference<A> = WorkerBoundReference(A(3).freeze())
@Test
@@ -85,7 +81,6 @@ fun testGlobalAccessOnWorkerFrozenInitially() {
worker.requestTermination().result
}
@SharedImmutable
val global4: WorkerBoundReference<A> = WorkerBoundReference(A(3))
@Test
@@ -103,7 +98,6 @@ fun testGlobalAccessOnWorkerFrozenBeforePassing() {
worker.requestTermination().result
}
@SharedImmutable
val global5: WorkerBoundReference<A> = WorkerBoundReference(A(3))
@Test
@@ -131,7 +125,6 @@ fun testGlobalAccessOnWorkerFrozenBeforeAccess() {
worker.requestTermination().result
}
@SharedImmutable
val global6: WorkerBoundReference<A> = WorkerBoundReference(A(3))
@Test
@@ -159,7 +152,6 @@ fun testGlobalModification() {
worker.requestTermination().result
}
@SharedImmutable
val global7: WorkerBoundReference<A> = WorkerBoundReference(A(3))
@Test
@@ -19,7 +19,6 @@ var topStringVar = "string"
val topSharedStringWithGetter: String
get() = "top"
val topData = Data(42)
@SharedImmutable
val topSharedData = Data(43)
@Test fun runTest1() {
@@ -88,7 +87,6 @@ val topSharedData = Data(43)
}
val atomicRef = AtomicReference<Any?>(Any().freeze())
@SharedImmutable
val stableRef = StableRef.create(Any().freeze())
val semaphore = AtomicInt(0)
@@ -51,7 +51,6 @@ fun initJobs(count: Int) = Array<Job?>(count) { i -> Job(i, i * 2, i)}
val COUNT = 2
@SharedImmutable
val counters = Array(COUNT) { AtomicInt(0) }
@Test fun runTest1() {
@@ -7,8 +7,6 @@
package test.text
@SharedImmutable
internal actual val surrogateCodePointDecoding: String = "\uFFFD".repeat(3)
@SharedImmutable
internal actual val surrogateCharEncoding: ByteArray = byteArrayOf(0xEF.toByte(), 0xBF.toByte(), 0xBD.toByte())
@@ -12,7 +12,6 @@ package test.text
import kotlin.test.*
@SharedImmutable
private val caseIgnorableRanges = arrayOf<IntRange>(
0x0027..0x0027,
0x002e..0x002e,
@@ -12,7 +12,6 @@ package test.text
import kotlin.test.*
@SharedImmutable
private val casedRanges = arrayOf<IntRange>(
0x0041..0x005a,
0x0061..0x007a,
@@ -11,7 +11,6 @@ package kotlin.text
//
// 1343 ranges totally
@SharedImmutable
private val rangeStart = intArrayOf(
0x0000, 0x0020, 0x0022, 0x0027, 0x002b, 0x002e, 0x0030, 0x003a, 0x003c, 0x003f, 0x0041, 0x005b, 0x005e, 0x0061, 0x007b, 0x007e, 0x007f, 0x00a0, 0x00a2, 0x00a6,
0x00aa, 0x00ad, 0x00b0, 0x00b3, 0x00b6, 0x00b9, 0x00bd, 0x00c0, 0x00d7, 0x00d8, 0x00df, 0x00f7, 0x00f8, 0x00ff, 0x0138, 0x0149, 0x0179, 0x017f, 0x0182, 0x0184,
@@ -83,7 +82,6 @@ private val rangeStart = intArrayOf(
0xfff9, 0xfffc, 0xfffe,
)
@SharedImmutable
private val rangeCategory = intArrayOf(
0x000f, 0x030c, 0x6b18, 0x5ab8, 0x5319, 0x0018, 0x0009, 0x0018, 0x0019, 0x0018, 0x0001, 0x5b15, 0x02fb, 0x0002, 0x5b35, 0x0019, 0x000f, 0x030c, 0x001a, 0x6f1c,
0x67a5, 0x6f90, 0x2f3c, 0x0b6b, 0x6f18, 0x78ab, 0x616b, 0x0001, 0x0019, 0x0001, 0x0002, 0x0019, 0x0002, 0x0022, 0x0022, 0x0022, 0x0041, 0x0442, 0x0041, 0x0441,
@@ -11,7 +11,6 @@ package kotlin.text
//
// 37 ranges totally
@SharedImmutable
private val rangeStart = intArrayOf(
0x0030, 0x0660, 0x06f0, 0x07c0, 0x0966, 0x09e6, 0x0a66, 0x0ae6, 0x0b66, 0x0be6, 0x0c66, 0x0ce6, 0x0d66, 0x0de6, 0x0e50, 0x0ed0, 0x0f20, 0x1040, 0x1090, 0x17e0,
0x1810, 0x1946, 0x19d0, 0x1a80, 0x1a90, 0x1b50, 0x1bb0, 0x1c40, 0x1c50, 0xa620, 0xa8d0, 0xa900, 0xa9d0, 0xa9f0, 0xaa50, 0xabf0, 0xff10,
@@ -11,7 +11,6 @@ package kotlin.text
//
// 222 ranges totally
@SharedImmutable
private val rangeStart = intArrayOf(
0x0041, 0x0061, 0x00aa, 0x00ba, 0x00c0, 0x00d8, 0x00df, 0x00f8, 0x00ff, 0x0138, 0x0149, 0x0172, 0x0181, 0x0190, 0x019f, 0x01ae, 0x01bd, 0x01cc, 0x01dd, 0x01e9,
0x01f8, 0x0231, 0x0240, 0x024f, 0x0294, 0x02a3, 0x02b2, 0x02ec, 0x0370, 0x037f, 0x038e, 0x039d, 0x03ac, 0x03c8, 0x03d7, 0x03ee, 0x03fd, 0x0430, 0x045f, 0x048a,
@@ -27,7 +26,6 @@ private val rangeStart = intArrayOf(
0xff66, 0xffd2,
)
@SharedImmutable
private val rangeLength = intArrayOf(
0x001a, 0x001a, 0x000c, 0x0001, 0x0017, 0x0007, 0x0018, 0x0007, 0x0039, 0x0011, 0x0029, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x0011, 0x000c, 0x000f,
0x0039, 0x000f, 0x000f, 0x0045, 0x000f, 0x000f, 0x0033, 0x0003, 0x000e, 0x000e, 0x000f, 0x000f, 0x001c, 0x000f, 0x0017, 0x000f, 0x0033, 0x002f, 0x0023, 0x0037,
@@ -43,7 +41,6 @@ private val rangeLength = intArrayOf(
0x006a, 0x000b,
)
@SharedImmutable
private val rangeCategory = intArrayOf(
0x0006, 0x0005, 0x1400003, 0x0007, 0x0006, 0x0006, 0x0005, 0x0005, 0x0019, 0x0019, 0x0019, 0x5599a666, 0x696a699a, 0x5a56a69a, 0x5966999a, 0x6d699a9a, 0x79e7bfd5, 0x0019, 0x0019, 0x699e5999,
0x0016, 0x5a695559, 0x66666a99, 0x0005, 0x55555557, 0x7d555555, 0x70c0840, 0x0013, 0x15706366, 0x18a88002, 0x6aaaaa9a, 0x6aaaa2aa, 0x0005, 0x56a59555, 0x0019, 0x56986556, 0x0006, 0x0005, 0x0019, 0x0016,
@@ -11,7 +11,6 @@ package kotlin.text
//
// 174 ranges totally
@SharedImmutable
private val rangeStart = intArrayOf(
0x0041, 0x00c0, 0x00d8, 0x0100, 0x0130, 0x0132, 0x0139, 0x014a, 0x0178, 0x0179, 0x0181, 0x0182, 0x0186, 0x0187, 0x0189, 0x018b, 0x018e, 0x018f, 0x0190, 0x0191,
0x0193, 0x0194, 0x0196, 0x0197, 0x0198, 0x019c, 0x019d, 0x019f, 0x01a0, 0x01a6, 0x01a7, 0x01a9, 0x01ac, 0x01ae, 0x01af, 0x01b1, 0x01b3, 0x01b7, 0x01b8, 0x01c4,
@@ -24,7 +23,6 @@ private val rangeStart = intArrayOf(
0xa7b4, 0xa7c2, 0xa7c4, 0xa7c5, 0xa7c6, 0xa7c7, 0xa7f5, 0xff21, 0x10400, 0x104b0, 0x10c80, 0x118a0, 0x16e40, 0x1e900,
)
@SharedImmutable
private val rangeLength = intArrayOf(
0x2011a, 0x20117, 0x20107, 0x122f, -0xc6eff, 0x1205, 0x120f, 0x122d, -0x78eff, 0x1205, 0xd2101, 0x1203, 0xce101, 0x1101, 0xcd102, 0x1101, 0x4f101, 0xca101, 0xcb101, 0x1101,
0xcd101, 0xcf101, 0xd3101, 0xd1101, 0x1101, 0xd3101, 0xd5101, 0xd6101, 0x1205, 0xda101, 0x1101, 0xda101, 0x1101, 0xda101, 0x1101, 0xd9102, 0x1203, 0xdb101, 0x1405, 0x2101,
@@ -11,7 +11,6 @@ package kotlin.text
//
// 102 mappings totally
@SharedImmutable
private val keys = intArrayOf(
0x00df, 0x0149, 0x01f0, 0x0390, 0x03b0, 0x0587, 0x1e96, 0x1e97, 0x1e98, 0x1e99, 0x1e9a, 0x1f50, 0x1f52, 0x1f54, 0x1f56, 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84,
0x1f85, 0x1f86, 0x1f87, 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f, 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97, 0x1f98,
@@ -20,7 +19,6 @@ private val keys = intArrayOf(
0x1fe3, 0x1fe4, 0x1fe6, 0x1fe7, 0x1ff2, 0x1ff3, 0x1ff4, 0x1ff6, 0x1ff7, 0x1ffc, 0xfb00, 0xfb01, 0xfb02, 0xfb03, 0xfb04, 0xfb05, 0xfb06, 0xfb13, 0xfb14, 0xfb15,
0xfb16, 0xfb17,
)
@SharedImmutable
private val values = arrayOf(
"\u0053\u0053", "\u02BC\u004E", "\u004A\u030C", "\u0399\u0308\u0301", "\u03A5\u0308\u0301", "\u0535\u0552", "\u0048\u0331", "\u0054\u0308", "\u0057\u030A", "\u0059\u030A", "\u0041\u02BE", "\u03A5\u0313", "\u03A5\u0313\u0300", "\u03A5\u0313\u0301", "\u03A5\u0313\u0342", "\u1F08\u0399", "\u1F09\u0399", "\u1F0A\u0399", "\u1F0B\u0399", "\u1F0C\u0399",
"\u1F0D\u0399", "\u1F0E\u0399", "\u1F0F\u0399", "\u1F08\u0399", "\u1F09\u0399", "\u1F0A\u0399", "\u1F0B\u0399", "\u1F0C\u0399", "\u1F0D\u0399", "\u1F0E\u0399", "\u1F0F\u0399", "\u1F28\u0399", "\u1F29\u0399", "\u1F2A\u0399", "\u1F2B\u0399", "\u1F2C\u0399", "\u1F2D\u0399", "\u1F2E\u0399", "\u1F2F\u0399", "\u1F28\u0399",
@@ -10,11 +10,9 @@ package kotlin.text
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
@SharedImmutable
private val otherLowerStart = intArrayOf(
0x00aa, 0x00ba, 0x02b0, 0x02c0, 0x02e0, 0x0345, 0x037a, 0x1d2c, 0x1d78, 0x1d9b, 0x2071, 0x207f, 0x2090, 0x2170, 0x24d0, 0x2c7c, 0xa69c, 0xa770, 0xa7f8, 0xab5c,
)
@SharedImmutable
private val otherLowerLength = intArrayOf(
1, 1, 9, 2, 5, 1, 1, 63, 1, 37, 1, 1, 13, 16, 26, 2, 2, 1, 2, 4,
)
@@ -10,12 +10,10 @@ package kotlin.text
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
@SharedImmutable
private val casedStart = intArrayOf(
0x10400, 0x104b0, 0x104d8, 0x10c80, 0x10cc0, 0x118a0, 0x16e40, 0x1d400, 0x1d456, 0x1d49e, 0x1d4a2, 0x1d4a5, 0x1d4a9, 0x1d4ae, 0x1d4bb, 0x1d4bd, 0x1d4c5, 0x1d507, 0x1d50d, 0x1d516,
0x1d51e, 0x1d53b, 0x1d540, 0x1d546, 0x1d54a, 0x1d552, 0x1d6a8, 0x1d6c2, 0x1d6dc, 0x1d6fc, 0x1d716, 0x1d736, 0x1d750, 0x1d770, 0x1d78a, 0x1d7aa, 0x1d7c4, 0x1e900,
)
@SharedImmutable
private val casedEnd = intArrayOf(
0x1044f, 0x104d3, 0x104fb, 0x10cb2, 0x10cf2, 0x118df, 0x16e7f, 0x1d454, 0x1d49c, 0x1d49f, 0x1d4a2, 0x1d4a6, 0x1d4ac, 0x1d4b9, 0x1d4bb, 0x1d4c3, 0x1d505, 0x1d50a, 0x1d514, 0x1d51c,
0x1d539, 0x1d53e, 0x1d544, 0x1d546, 0x1d550, 0x1d6a5, 0x1d6c0, 0x1d6da, 0x1d6fa, 0x1d714, 0x1d734, 0x1d74e, 0x1d76e, 0x1d788, 0x1d7a8, 0x1d7c2, 0x1d7cb, 0x1e943,
@@ -38,7 +36,6 @@ internal fun Int.isCased(): Boolean {
return index >= 0 && this <= casedEnd[index]
}
@SharedImmutable
private val caseIgnorableStart = intArrayOf(
0x0027, 0x002e, 0x003a, 0x00b7, 0x0387, 0x055f, 0x05f4, 0x2018, 0x2019, 0x2024, 0x2027, 0xfe13, 0xfe52, 0xfe55, 0xff07, 0xff0e, 0xff1a, 0x101fd, 0x102e0, 0x10376,
0x10a01, 0x10a05, 0x10a0c, 0x10a38, 0x10a3f, 0x10ae5, 0x10d24, 0x10eab, 0x10f46, 0x11001, 0x11038, 0x1107f, 0x110b3, 0x110b9, 0x110bd, 0x110cd, 0x11100, 0x11127, 0x1112d, 0x11173,
@@ -49,7 +46,6 @@ private val caseIgnorableStart = intArrayOf(
0x1d173, 0x1d185, 0x1d1aa, 0x1d242, 0x1da00, 0x1da3b, 0x1da75, 0x1da84, 0x1da9b, 0x1daa1, 0x1e000, 0x1e008, 0x1e01b, 0x1e023, 0x1e026, 0x1e130, 0x1e2ec, 0x1e8d0, 0x1e944, 0x1f3fb,
0xe0001, 0xe0020, 0xe0100,
)
@SharedImmutable
private val caseIgnorableEnd = intArrayOf(
0x0027, 0x002e, 0x003a, 0x00b7, 0x0387, 0x055f, 0x05f4, 0x2018, 0x2019, 0x2024, 0x2027, 0xfe13, 0xfe52, 0xfe55, 0xff07, 0xff0e, 0xff1a, 0x101fd, 0x102e0, 0x1037a,
0x10a03, 0x10a06, 0x10a0f, 0x10a3a, 0x10a3f, 0x10ae6, 0x10d27, 0x10eac, 0x10f50, 0x11001, 0x11046, 0x11081, 0x110b6, 0x110ba, 0x110bd, 0x110cd, 0x11102, 0x1112b, 0x11134, 0x11173,
@@ -11,7 +11,6 @@ package kotlin.text
//
// 189 ranges totally
@SharedImmutable
private val rangeStart = intArrayOf(
0x0061, 0x00b5, 0x00e0, 0x00f8, 0x00ff, 0x0101, 0x0131, 0x0133, 0x013a, 0x014b, 0x017a, 0x017f, 0x0180, 0x0183, 0x0188, 0x0192, 0x0195, 0x0199, 0x019a, 0x019e,
0x01a1, 0x01a8, 0x01b0, 0x01b6, 0x01bd, 0x01bf, 0x01c5, 0x01c6, 0x01c8, 0x01c9, 0x01cb, 0x01cc, 0x01ce, 0x01dd, 0x01df, 0x01f2, 0x01f3, 0x01f5, 0x01fb, 0x0223,
@@ -25,7 +24,6 @@ private val rangeStart = intArrayOf(
0xab53, 0xab70, 0xff41, 0x10428, 0x104d8, 0x10cc0, 0x118c0, 0x16e60, 0x1e922,
)
@SharedImmutable
private val rangeLength = intArrayOf(
-0x1fee6, 0x2e7101, -0x1fee9, -0x1fef9, 0x79101, -0x0dd1, -0xe7eff, -0x0dfb, -0x0df1, -0x0dd3, -0x0dfb, -0x12beff, 0xc3101, -0x0dfd, -0x0bfb, -0x0eff, 0x61101, -0x0eff, 0xa3101, 0x82101,
-0x0dfb, -0x0afa, -0x0bfb, -0x0cfc, -0x0eff, 0x38101, -0x0eff, -0x1eff, -0x0eff, -0x1eff, -0x0eff, -0x1eff, -0x0df1, -0x4eeff, -0x0def, -0x0eff, -0x1eff, -0x0bfb, -0x0ddb, -0x0def,
@@ -62,6 +62,9 @@ public typealias Throws = kotlin.Throws
public typealias ThreadLocal = kotlin.native.concurrent.ThreadLocal
/** @suppress */
@Suppress("DEPRECATION")
@Deprecated("This annotation is redundant and has no effect")
@DeprecatedSinceKotlin(warningSince = "1.9")
// Not @FreezingIsDeprecated: Lots of usages. Usages will trigger INFO reports in the frontend.
public typealias SharedImmutable = kotlin.native.concurrent.SharedImmutable
@@ -31,6 +31,8 @@ public actual annotation class ThreadLocal
* Since 1.7.20 usage of this annotation is deprecated.
* See https://kotlinlang.org/docs/native-migration-guide.html for details.
*/
@Deprecated("This annotation is redundant and has no effect")
@DeprecatedSinceKotlin(warningSince = "1.9")
@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.BINARY)
// Not @FreezingIsDeprecated: Lots of usages, only the doc updated.
@@ -83,7 +83,6 @@ public fun Char.Companion.toChars(codePoint: Int): CharArray =
else -> throw IllegalArgumentException()
}
@SharedImmutable
private val digits = intArrayOf(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
-1, -1, -1, -1, -1, -1, -1,
@@ -5,7 +5,6 @@
package kotlin.text
import kotlin.native.concurrent.SharedImmutable
import kotlin.native.internal.GCUnsafeCall
/**
@@ -505,7 +504,6 @@ public actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase:
this.contentEqualsImpl(other)
}
@SharedImmutable
private val STRING_CASE_INSENSITIVE_ORDER = Comparator<String> { a, b -> a.compareTo(b, ignoreCase = true) }
public actual val String.Companion.CASE_INSENSITIVE_ORDER: Comparator<String>
@@ -33,6 +33,8 @@ public expect annotation class ThreadLocal()
*
* Since 1.7.20 usage of this annotation is deprecated. See https://kotlinlang.org/docs/native-migration-guide.html for details.
*/
@Deprecated("This annotation is redundant and has no effect")
@DeprecatedSinceKotlin(warningSince = "1.9")
@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.BINARY)
// Not @FreezingIsDeprecated: Lots of usages, only the doc updated.
@@ -5,8 +5,6 @@
package kotlin.io.encoding
import kotlin.native.concurrent.SharedImmutable
// Benchmarks repository: https://github.com/qurbonzoda/KotlinBase64Benchmarks
/**
@@ -568,7 +566,6 @@ public open class Base64 private constructor(
// "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
@SharedImmutable
private val base64EncodeMap = byteArrayOf(
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 0 - 15 */
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, /* 16 - 31 */
@@ -577,7 +574,6 @@ private val base64EncodeMap = byteArrayOf(
)
@ExperimentalEncodingApi
@SharedImmutable
private val base64DecodeMap = IntArray(256).apply {
this.fill(-1)
this[Base64.padSymbol.toInt()] = -2
@@ -587,7 +583,6 @@ private val base64DecodeMap = IntArray(256).apply {
}
// "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
@SharedImmutable
private val base64UrlEncodeMap = byteArrayOf(
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 0 - 15 */
81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, /* 16 - 31 */
@@ -596,7 +591,6 @@ private val base64UrlEncodeMap = byteArrayOf(
)
@ExperimentalEncodingApi
@SharedImmutable
private val base64UrlDecodeMap = IntArray(256).apply {
this.fill(-1)
this[Base64.padSymbol.toInt()] = -2
@@ -5,13 +5,10 @@
package kotlin.text
import kotlin.native.concurrent.SharedImmutable
private const val LOWER_CASE_HEX_DIGITS = "0123456789abcdef"
private const val UPPER_CASE_HEX_DIGITS = "0123456789ABCDEF"
// case-insensitive parsing
@SharedImmutable
private val HEX_DIGITS_TO_DECIMAL = IntArray(128) { -1 }.apply {
LOWER_CASE_HEX_DIGITS.forEachIndexed { index, char -> this[char.code] = index }
UPPER_CASE_HEX_DIGITS.forEachIndexed { index, char -> this[char.code] = index }
@@ -7,7 +7,6 @@ package kotlin
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
import kotlin.native.concurrent.SharedImmutable
/**
* Defines deep recursive function that keeps its stack on the heap,
@@ -124,7 +123,6 @@ public sealed class DeepRecursiveScope<T, R> {
private typealias DeepRecursiveFunctionBlock = suspend DeepRecursiveScope<*, *>.(Any?) -> Any?
@SharedImmutable
private val UNDEFINED_RESULT = Result.success(COROUTINE_SUSPENDED)
@Suppress("UNCHECKED_CAST")
@@ -5,7 +5,6 @@
package test.comparisons
import kotlin.native.concurrent.SharedImmutable
import kotlin.test.*
data class Item(val name: String, val rating: Int) : Comparable<Item> {
@@ -14,7 +13,6 @@ data class Item(val name: String, val rating: Int) : Comparable<Item> {
}
}
@SharedImmutable
val STRING_CASE_INSENSITIVE_ORDER: Comparator<String> =
compareBy { it: String -> it.uppercase() }.thenBy { it.lowercase() }.thenBy { it }
-2
View File
@@ -10,7 +10,6 @@ import test.*
import test.collections.behaviors.iteratorBehavior
import test.collections.compare
import kotlin.math.sign
import kotlin.native.concurrent.SharedImmutable
import kotlin.random.Random
@@ -18,7 +17,6 @@ fun createString(content: String): CharSequence = content
fun createStringBuilder(content: String): CharSequence = StringBuilder((content as Any).toString()) // required for Rhino JS
@SharedImmutable
val charSequenceBuilders = listOf(::createString, ::createStringBuilder)
fun withOneCharSequenceArg(f: ((String) -> CharSequence) -> Unit) {
@@ -9,7 +9,6 @@ package test.time
import test.numbers.assertAlmostEquals
import kotlin.math.nextDown
import kotlin.math.pow
import kotlin.native.concurrent.SharedImmutable
import kotlin.test.*
import kotlin.time.*
import kotlin.random.*
@@ -21,7 +20,6 @@ import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.nanoseconds
import kotlin.time.Duration.Companion.seconds
@SharedImmutable
private val units = DurationUnit.values()
class DurationTest {
@@ -34,7 +34,6 @@ private fun FileWriter.writeCollection(
append(strategy.indentation + string)
}
append(strategy.rangesAnnotation)
appendWithIndentation("${strategy.rangesVisibilityModifier} val $name = $constructingFun(")
for (i in elements.indices) {
if (i % 20 == 0) {
@@ -54,7 +54,6 @@ internal class StringCasingTestGenerator(private val outputDir: File) {
writer.appendLine()
writer.appendLine("import kotlin.test.*")
writer.appendLine()
writer.appendLine("@SharedImmutable")
writer.appendLine("private val $rangesArrayName = arrayOf<IntRange>(")
ranges.forEach {
writer.appendLine(" ${it.hexIntRangeLiteral()},")
@@ -12,7 +12,6 @@ import java.io.FileWriter
internal sealed class RangesWritingStrategy {
abstract val indentation: String
abstract val rangesAnnotation: String
abstract val rangesVisibilityModifier: String
abstract fun beforeWritingRanges(writer: FileWriter)
abstract fun afterWritingRanges(writer: FileWriter)
@@ -22,15 +21,14 @@ internal sealed class RangesWritingStrategy {
fun of(target: KotlinTarget, wrapperName: String? = null): RangesWritingStrategy {
return when (target.platform) {
Platform.JS -> JsRangesWritingStrategy(wrapperName!!)
else -> NativeRangesWritingStrategy(useNativeRangesAnnotation = target.backend != Backend.Wasm)
else -> NativeRangesWritingStrategy
}
}
}
}
internal class NativeRangesWritingStrategy(private val useNativeRangesAnnotation: Boolean) : RangesWritingStrategy() {
internal object NativeRangesWritingStrategy : RangesWritingStrategy() {
override val indentation: String get() = ""
override val rangesAnnotation: String get() = if (useNativeRangesAnnotation) "@SharedImmutable\n" else ""
override val rangesVisibilityModifier: String get() = "private"
override fun beforeWritingRanges(writer: FileWriter) {}
override fun afterWritingRanges(writer: FileWriter) {}
@@ -42,7 +40,6 @@ internal class JsRangesWritingStrategy(
private val wrapperName: String
) : RangesWritingStrategy() {
override val indentation: String get() = " ".repeat(4)
override val rangesAnnotation: String get() = ""
override val rangesVisibilityModifier: String get() = "internal"
override fun beforeWritingRanges(writer: FileWriter) {