Remove Cloneable interface (#347)
This commit is contained in:
@@ -44,17 +44,6 @@ void Kotlin_Array_set(KRef thiz, KInt index, KConstRef value) {
|
||||
UpdateGlobalRef(ArrayAddressOfElementAt(array, index), value);
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_Array_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
for (int index = 0; index < array->count_; index++) {
|
||||
SetGlobalRef(
|
||||
ArrayAddressOfElementAt(result, index), *ArrayAddressOfElementAt(array, index));
|
||||
}
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
KInt Kotlin_Array_getArrayLength(KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
return array->count_;
|
||||
@@ -109,17 +98,6 @@ void Kotlin_ByteArray_set(KRef thiz, KInt index, KByte value) {
|
||||
*ByteArrayAddressOfElementAt(array, index) = value;
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_ByteArray_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
memcpy(
|
||||
ByteArrayAddressOfElementAt(result, 0),
|
||||
ByteArrayAddressOfElementAt(array, 0),
|
||||
ArrayDataSizeBytes(array));
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
KInt Kotlin_ByteArray_getArrayLength(KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
return array->count_;
|
||||
@@ -141,17 +119,6 @@ void Kotlin_CharArray_set(KRef thiz, KInt index, KChar value) {
|
||||
*PrimitiveArrayAddressOfElementAt<KChar>(array, index) = value;
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_CharArray_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
memcpy(
|
||||
PrimitiveArrayAddressOfElementAt<KChar>(result, 0),
|
||||
PrimitiveArrayAddressOfElementAt<KChar>(array, 0),
|
||||
ArrayDataSizeBytes(array));
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_CharArray_copyOf, KConstRef thiz, KInt newSize) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = ArrayContainer(
|
||||
@@ -185,17 +152,6 @@ void Kotlin_ShortArray_set(KRef thiz, KInt index, KShort value) {
|
||||
*PrimitiveArrayAddressOfElementAt<KShort>(array, index) = value;
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_ShortArray_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
memcpy(
|
||||
PrimitiveArrayAddressOfElementAt<KShort>(result, 0),
|
||||
PrimitiveArrayAddressOfElementAt<KShort>(array, 0),
|
||||
ArrayDataSizeBytes(array));
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
KInt Kotlin_ShortArray_getArrayLength(KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
return array->count_;
|
||||
@@ -217,17 +173,6 @@ void Kotlin_IntArray_set(KRef thiz, KInt index, KInt value) {
|
||||
*PrimitiveArrayAddressOfElementAt<KInt>(array, index) = value;
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_IntArray_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
memcpy(
|
||||
PrimitiveArrayAddressOfElementAt<KInt>(result, 0),
|
||||
PrimitiveArrayAddressOfElementAt<KInt>(array, 0),
|
||||
ArrayDataSizeBytes(array));
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
KInt Kotlin_IntArray_getArrayLength(KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
return array->count_;
|
||||
@@ -300,17 +245,6 @@ void Kotlin_LongArray_set(KRef thiz, KInt index, KLong value) {
|
||||
*PrimitiveArrayAddressOfElementAt<KLong>(array, index) = value;
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_LongArray_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
memcpy(
|
||||
PrimitiveArrayAddressOfElementAt<KLong>(result, 0),
|
||||
PrimitiveArrayAddressOfElementAt<KLong>(array, 0),
|
||||
ArrayDataSizeBytes(array));
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
KInt Kotlin_LongArray_getArrayLength(KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
return array->count_;
|
||||
@@ -332,17 +266,6 @@ void Kotlin_FloatArray_set(KRef thiz, KInt index, KFloat value) {
|
||||
*PrimitiveArrayAddressOfElementAt<KFloat>(array, index) = value;
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_FloatArray_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
memcpy(
|
||||
PrimitiveArrayAddressOfElementAt<KFloat>(result, 0),
|
||||
PrimitiveArrayAddressOfElementAt<KFloat>(array, 0),
|
||||
ArrayDataSizeBytes(array));
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
KInt Kotlin_FloatArray_getArrayLength(KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
return array->count_;
|
||||
@@ -364,17 +287,6 @@ void Kotlin_DoubleArray_set(KRef thiz, KInt index, KDouble value) {
|
||||
*PrimitiveArrayAddressOfElementAt<KDouble>(array, index) = value;
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_DoubleArray_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
memcpy(
|
||||
PrimitiveArrayAddressOfElementAt<KDouble>(result, 0),
|
||||
PrimitiveArrayAddressOfElementAt<KDouble>(array, 0),
|
||||
ArrayDataSizeBytes(array));
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
KInt Kotlin_DoubleArray_getArrayLength(KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
return array->count_;
|
||||
@@ -396,17 +308,6 @@ void Kotlin_BooleanArray_set(KRef thiz, KInt index, KBoolean value) {
|
||||
*PrimitiveArrayAddressOfElementAt<KBoolean>(array, index) = value;
|
||||
}
|
||||
|
||||
OBJ_GETTER(Kotlin_BooleanArray_clone, KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
ArrayHeader* result = AllocArrayInstance(
|
||||
array->type_info(), array->count_, OBJ_RESULT)->array();
|
||||
memcpy(
|
||||
PrimitiveArrayAddressOfElementAt<KBoolean>(result, 0),
|
||||
PrimitiveArrayAddressOfElementAt<KBoolean>(array, 0),
|
||||
ArrayDataSizeBytes(array));
|
||||
RETURN_OBJ(result->obj());
|
||||
}
|
||||
|
||||
KInt Kotlin_BooleanArray_getArrayLength(KConstRef thiz) {
|
||||
const ArrayHeader* array = thiz->array();
|
||||
return array->count_;
|
||||
|
||||
@@ -3,7 +3,7 @@ import konan.internal.ExportForCompiler
|
||||
|
||||
// TODO: remove that, as RTTI shall be per instantiation.
|
||||
@ExportTypeInfo("theArrayTypeInfo")
|
||||
public final class Array<T> : Cloneable {
|
||||
public final class Array<T> {
|
||||
// Constructors are handled with compiler magic.
|
||||
public constructor(size: Int, init: (Int) -> T) {
|
||||
var index = 0
|
||||
@@ -19,9 +19,6 @@ public final class Array<T> : Cloneable {
|
||||
public val size: Int
|
||||
get() = getArrayLength()
|
||||
|
||||
@SymbolName("Kotlin_Array_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_Array_get")
|
||||
external public operator fun get(index: Int): T
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import kotlin.util.sortArrayWith
|
||||
* @constructor Creates a new array of the specified [size], with all elements initialized to zero.
|
||||
*/
|
||||
@ExportTypeInfo("theByteArrayTypeInfo")
|
||||
public final class ByteArray : Cloneable {
|
||||
public final class ByteArray {
|
||||
// Constructors are handled with compiler magic.
|
||||
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
|
||||
|
||||
@@ -24,9 +24,6 @@ public final class ByteArray : Cloneable {
|
||||
@SymbolName("Kotlin_ByteArray_set")
|
||||
external public operator fun set(index: Int, value: Byte): Unit
|
||||
|
||||
@SymbolName("Kotlin_ByteArray_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_ByteArray_getArrayLength")
|
||||
external private fun getArrayLength(): Int
|
||||
|
||||
@@ -54,7 +51,7 @@ private class ByteIteratorImpl(val collection: ByteArray) : ByteIterator() {
|
||||
* @constructor Creates a new array of the specified [size], with all elements initialized to zero.
|
||||
*/
|
||||
@ExportTypeInfo("theCharArrayTypeInfo")
|
||||
public final class CharArray : Cloneable {
|
||||
public final class CharArray {
|
||||
// Constructors are handled with the compiler magic.
|
||||
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
|
||||
|
||||
@@ -67,9 +64,6 @@ public final class CharArray : Cloneable {
|
||||
@SymbolName("Kotlin_CharArray_set")
|
||||
external public operator fun set(index: Int, value: Char): Unit
|
||||
|
||||
@SymbolName("Kotlin_CharArray_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_CharArray_copyOf")
|
||||
external public fun copyOf(newSize: Int): CharArray
|
||||
|
||||
@@ -99,7 +93,7 @@ private class CharIteratorImpl(val collection: CharArray) : CharIterator() {
|
||||
* @constructor Creates a new array of the specified [size], with all elements initialized to zero.
|
||||
*/
|
||||
@ExportTypeInfo("theShortArrayTypeInfo")
|
||||
public final class ShortArray : Cloneable {
|
||||
public final class ShortArray {
|
||||
// Constructors are handled with the compiler magic.
|
||||
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
|
||||
|
||||
@@ -112,9 +106,6 @@ public final class ShortArray : Cloneable {
|
||||
@SymbolName("Kotlin_ShortArray_set")
|
||||
external public operator fun set(index: Int, value: Short): Unit
|
||||
|
||||
@SymbolName("Kotlin_ShortArray_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_ShortArray_getArrayLength")
|
||||
external private fun getArrayLength(): Int
|
||||
|
||||
@@ -141,7 +132,7 @@ private class ShortIteratorImpl(val collection: ShortArray) : ShortIterator() {
|
||||
* @constructor Creates a new array of the specified [size], with all elements initialized to zero.
|
||||
*/
|
||||
@ExportTypeInfo("theIntArrayTypeInfo")
|
||||
public final class IntArray : Cloneable {
|
||||
public final class IntArray {
|
||||
// Constructors are handled with the compiler magic.
|
||||
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
|
||||
|
||||
@@ -154,9 +145,6 @@ public final class IntArray : Cloneable {
|
||||
@SymbolName("Kotlin_IntArray_set")
|
||||
external public operator fun set(index: Int, value: Int): Unit
|
||||
|
||||
@SymbolName("Kotlin_IntArray_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_IntArray_getArrayLength")
|
||||
external private fun getArrayLength(): Int
|
||||
|
||||
@@ -183,7 +171,7 @@ private class IntIteratorImpl(val collection: IntArray) : IntIterator() {
|
||||
* @constructor Creates a new array of the specified [size], with all elements initialized to zero.
|
||||
*/
|
||||
@ExportTypeInfo("theLongArrayTypeInfo")
|
||||
public final class LongArray : Cloneable {
|
||||
public final class LongArray {
|
||||
// Constructors are handled with the compiler magic.
|
||||
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
|
||||
|
||||
@@ -196,9 +184,6 @@ public final class LongArray : Cloneable {
|
||||
@SymbolName("Kotlin_LongArray_set")
|
||||
external public operator fun set(index: Int, value: Long): Unit
|
||||
|
||||
@SymbolName("Kotlin_LongArray_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_LongArray_getArrayLength")
|
||||
external private fun getArrayLength(): Int
|
||||
|
||||
@@ -225,7 +210,7 @@ private class LongIteratorImpl(val collection: LongArray) : LongIterator() {
|
||||
* @constructor Creates a new array of the specified [size], with all elements initialized to zero.
|
||||
*/
|
||||
@ExportTypeInfo("theFloatArrayTypeInfo")
|
||||
public final class FloatArray : Cloneable {
|
||||
public final class FloatArray {
|
||||
// Constructors are handled with the compiler magic.
|
||||
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
|
||||
|
||||
@@ -238,9 +223,6 @@ public final class FloatArray : Cloneable {
|
||||
@SymbolName("Kotlin_FloatArray_set")
|
||||
external public operator fun set(index: Int, value: Float): Unit
|
||||
|
||||
@SymbolName("Kotlin_FloatArray_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_FloatArray_getArrayLength")
|
||||
external private fun getArrayLength(): Int
|
||||
|
||||
@@ -263,7 +245,7 @@ private class FloatIteratorImpl(val collection: FloatArray) : FloatIterator() {
|
||||
}
|
||||
|
||||
@ExportTypeInfo("theDoubleArrayTypeInfo")
|
||||
public final class DoubleArray : Cloneable {
|
||||
public final class DoubleArray {
|
||||
// Constructors are handled with the compiler magic.
|
||||
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
|
||||
|
||||
@@ -276,9 +258,6 @@ public final class DoubleArray : Cloneable {
|
||||
@SymbolName("Kotlin_DoubleArray_set")
|
||||
external public operator fun set(index: Int, value: Double): Unit
|
||||
|
||||
@SymbolName("Kotlin_DoubleArray_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_DoubleArray_getArrayLength")
|
||||
external private fun getArrayLength(): Int
|
||||
|
||||
@@ -301,7 +280,7 @@ private class DoubleIteratorImpl(val collection: DoubleArray) : DoubleIterator()
|
||||
}
|
||||
|
||||
@ExportTypeInfo("theBooleanArrayTypeInfo")
|
||||
public final class BooleanArray : Cloneable {
|
||||
public final class BooleanArray {
|
||||
// Constructors are handled with the compiler magic.
|
||||
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
|
||||
|
||||
@@ -314,9 +293,6 @@ public final class BooleanArray : Cloneable {
|
||||
@SymbolName("Kotlin_BooleanArray_set")
|
||||
external public operator fun set(index: Int, value: Boolean): Unit
|
||||
|
||||
@SymbolName("Kotlin_BooleanArray_clone")
|
||||
external public override fun clone(): Any
|
||||
|
||||
@SymbolName("Kotlin_BooleanArray_getArrayLength")
|
||||
external private fun getArrayLength(): Int
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package kotlin
|
||||
|
||||
@ExportTypeInfo("theCloneableTypeInfo")
|
||||
public interface Cloneable {
|
||||
public fun clone(): Any
|
||||
}
|
||||
Reference in New Issue
Block a user