[compiler][update] 1.3-M2-eap-82

This commit is contained in:
Vasily Levchenko
2018-08-21 19:35:22 +03:00
parent 4ac6e4bffb
commit 0fed84a2cd
7 changed files with 71 additions and 6 deletions
+3 -3
View File
@@ -16,11 +16,11 @@
# A version of the Kotlin "toolchain" (compiler, runtime, stdlib etc) used by the build script.
buildKotlinVersion=1.3-M1-eap-77
buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_13M1_Compiler),number:1.3-M1-eap-77,branch:default:any/artifacts/content/maven/
buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_13M1_Compiler),number:1.3-M1-eap-77,branch:default:any/artifacts/content/maven
remoteRoot=konan_tests
testDataVersion=1226829:id
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_13M2_CompilerAllPlugins),number:1.3-M2-eap-33,tag:kotlin-native,pinned:true/artifacts/content/maven
kotlinVersion=1.3-M2-eap-33
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_13M2_CompilerAllPlugins),number:1.3-M2-eap-82,tag:kotlin-native,pinned:true/artifacts/content/maven
kotlinVersion=1.3-M2-eap-82
testKotlinVersion=1.3-M2-eap-33
konanVersion=0.9
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
+23
View File
@@ -737,6 +737,29 @@ KInt Kotlin_String_compareTo(KString thiz, KString other) {
return diff < 0 ? -1 : 1;
}
KInt Kotlin_String_compareToIgnoreCase(KString thiz, KConstRef other) {
RuntimeAssert(thiz->type_info() == theStringTypeInfo &&
other->type_info() == theStringTypeInfo, "Must be strings");
// Important, due to literal internalization.
KString otherString = other->array();
if (thiz == otherString) return 0;
auto count = thiz->count_ < otherString->count_ ? thiz->count_ : otherString->count_;
const KChar* thizRaw = CharArrayAddressOfElementAt(thiz, 0);
const KChar* otherRaw = CharArrayAddressOfElementAt(otherString, 0);
for (KInt index = 0; index < count; ++index) {
int diff = towlower_Konan(*thizRaw++) - towlower_Konan(*otherRaw++);
if (diff != 0)
return diff < 0 ? -1 : 1;
}
if (otherString->count_ == thiz->count_)
return 0;
else if (otherString->count_ > thiz->count_)
return -1;
else
return 1;
}
KChar Kotlin_String_get(KString thiz, KInt index) {
if (static_cast<uint32_t>(index) >= thiz->count_) {
ThrowArrayIndexOutOfBoundsException();
+1
View File
@@ -122,6 +122,7 @@ OBJ_GETTER(Kotlin_Int_toString, KInt value);
KInt Kotlin_String_hashCode(KString thiz);
KBoolean Kotlin_String_equals(KString thiz, KConstRef other);
KInt Kotlin_String_compareTo(KString thiz, KString other);
KInt Kotlin_String_compareToIgnoreCase(KString thiz, KConstRef other);
KChar Kotlin_String_get(KString thiz, KInt index);
OBJ_GETTER(Kotlin_String_fromUtf8Array, KConstRef array, KInt start, KInt size);
OBJ_GETTER(Kotlin_String_fromCharArray, KConstRef array, KInt start, KInt size);
+3 -3
View File
@@ -124,10 +124,10 @@ public open class TypeCastException : ClassCastException {
constructor(message: String?) : super(message)
}
public open class ArithmeticException : RuntimeException {
constructor() : super()
public actual open class ArithmeticException : RuntimeException {
actual constructor() : super()
constructor(message: String?) : super(message)
actual constructor(message: String?) : super(message)
}
public actual open class AssertionError : Error {
@@ -17,6 +17,7 @@
package kotlin.collections
import kotlin.comparisons.*
import kotlin.internal.InlineOnly
import kotlin.random.*
// Copies typed varargs array to an array of objects
@@ -246,3 +247,24 @@ public actual fun <T> MutableList<T>.shuffle(): Unit {
@SinceKotlin("1.2")
public actual fun <T> Iterable<T>.shuffled(): List<T> = toMutableList().apply { shuffle() }
@PublishedApi
@SinceKotlin("1.3")
@InlineOnly
internal actual inline fun checkIndexOverflow(index: Int): Int {
if (index < 0) {
// TODO: api version check?
throwIndexOverflow()
}
return index
}
@PublishedApi
@SinceKotlin("1.3")
@InlineOnly
internal actual inline fun checkCountOverflow(count: Int): Int {
if (count < 0) {
// TODO: api version check?
throwCountOverflow()
}
return count
}
@@ -38,4 +38,10 @@ class NativePtr @PublishedApi internal constructor(private val value: NonNullNat
internal inline class NonNullNativePtr(val value: NotNullPointerValue) { // TODO: refactor to use this type widely.
@Suppress("NOTHING_TO_INLINE")
inline fun toNativePtr() = NativePtr(this)
// TODO: fixme.
override fun toString() = ""
override fun hashCode() = 0
override fun equals(other: Any?) = false
}
@@ -55,3 +55,16 @@ public actual fun String(chars: CharArray): String = fromCharArray(chars, 0, cha
* Converts the characters from a portion of the specified array to a string.
*/
public actual fun String(chars: CharArray, offset: Int, length: Int): String = fromCharArray(chars, offset, length)
@SymbolName("Kotlin_String_compareToIgnoreCase")
external fun compareToIgnoreCase(thiz:String, other:String):Int
actual fun String.compareTo(other: String, ignoreCase: Boolean): Int {
return if (!ignoreCase) this.compareTo(other)
else compareToIgnoreCase(this, other)
}
private val STRING_CASE_INSENSITIVE_ORDER = Comparator<String> { a, b -> a.compareTo(b, ignoreCase = true) }
actual val String.Companion.CASE_INSENSITIVE_ORDER: Comparator<String>
get() = STRING_CASE_INSENSITIVE_ORDER