Use actual form of decodeSerializableElement function in 'decodeSequentially'
code path in deserialize. Old 3-argument form is deprecated and should be removed.
This commit is contained in:
+2
-3
@@ -404,7 +404,6 @@ open class SerializerIrGenerator(val irClass: IrClass, final override val compil
|
||||
genericIndex = property.genericIndex
|
||||
)
|
||||
val isSerializable = innerSerial != null
|
||||
// todo: update
|
||||
val decodeFuncToCall =
|
||||
(if (isSerializable) "${CallingConventions.decode}${sti.elementMethodPrefix}Serializable${CallingConventions.elementPostfix}"
|
||||
else "${CallingConventions.decode}${sti.elementMethodPrefix}${CallingConventions.elementPostfix}")
|
||||
@@ -414,8 +413,8 @@ open class SerializerIrGenerator(val irClass: IrClass, final override val compil
|
||||
val typeArgs =
|
||||
if (decodeFuncToCall.descriptor.typeParameters.isNotEmpty()) listOf(property.type.toIrType()) else listOf()
|
||||
val args = mutableListOf<IrExpression>(localSerialDesc.get(), irInt(index))
|
||||
if (innerSerial != null) {
|
||||
args.add(innerSerial)
|
||||
if (isSerializable) {
|
||||
args.add(innerSerial!!)
|
||||
args.add(localProps[index].get())
|
||||
}
|
||||
// local$i = localInput.decode...(...)
|
||||
|
||||
+5
-6
@@ -334,7 +334,7 @@ open class SerializerCodegenImpl(
|
||||
propVar = propsStartVar
|
||||
for ((index, property) in serializableProperties.withIndex()) {
|
||||
val propertyType = codegen.typeMapper.mapType(property.type)
|
||||
callReadProperty(property, propertyType, index, inputVar, descVar, -1, propVar)
|
||||
callReadProperty(property, propertyType, index, inputVar, descVar, propVar)
|
||||
propVar += propertyType.size
|
||||
}
|
||||
// set all bit masks to true
|
||||
@@ -373,7 +373,7 @@ open class SerializerCodegenImpl(
|
||||
val propertyAddressInBitMask = bitMaskOff(index)
|
||||
// labelI:
|
||||
visitLabel(labels[labelNum + 1])
|
||||
callReadProperty(property, propertyType, index, inputVar, descVar, propertyAddressInBitMask, propVar)
|
||||
callReadProperty(property, propertyType, index, inputVar, descVar, propVar)
|
||||
|
||||
// mark read bit in mask
|
||||
// bitMask = bitMask | 1 << index
|
||||
@@ -454,7 +454,6 @@ open class SerializerCodegenImpl(
|
||||
index: Int,
|
||||
inputVar: Int,
|
||||
descriptorVar: Int,
|
||||
propertyAddressInBitMask: Int,
|
||||
propertyVar: Int
|
||||
) {
|
||||
// propX := input.readXxxValue(value)
|
||||
@@ -482,12 +481,12 @@ open class SerializerCodegenImpl(
|
||||
)
|
||||
}
|
||||
|
||||
val isUpdatable = useSerializer && propertyAddressInBitMask != -1
|
||||
if (isUpdatable) {
|
||||
if (useSerializer) {
|
||||
// then it is not a primitive and can be updated via `oldValue` parameter in decodeSerializableElement
|
||||
load(propertyVar, propertyType)
|
||||
StackValue.coerce(propertyType, sti.type, this)
|
||||
}
|
||||
produceCall(isUpdatable)
|
||||
produceCall(useSerializer)
|
||||
|
||||
StackValue.coerce(sti.type, propertyType, this)
|
||||
store(propertyVar, propertyType)
|
||||
|
||||
+4
-2
@@ -80,7 +80,8 @@ public final class ListOfUsers$$serializer : java/lang/Object, kotlinx/serializa
|
||||
GETSTATIC (INSTANCE, LUser$$serializer;)
|
||||
CHECKCAST
|
||||
INVOKESPECIAL (kotlinx/serialization/internal/ArrayListSerializer, <init>, (Lkotlinx/serialization/KSerializer;)V)
|
||||
INVOKEINTERFACE (kotlinx/serialization/encoding/CompositeDecoder, decodeSerializableElement, (Lkotlinx/serialization/descriptors/SerialDescriptor;ILkotlinx/serialization/DeserializationStrategy;)Ljava/lang/Object;)
|
||||
ALOAD (5)
|
||||
INVOKEINTERFACE (kotlinx/serialization/encoding/CompositeDecoder, decodeSerializableElement, (Lkotlinx/serialization/descriptors/SerialDescriptor;ILkotlinx/serialization/DeserializationStrategy;Ljava/lang/Object;)Ljava/lang/Object;)
|
||||
CHECKCAST
|
||||
ASTORE (5)
|
||||
LDC (2147483647)
|
||||
@@ -365,7 +366,8 @@ public final class OptionalUser$$serializer : java/lang/Object, kotlinx/serializ
|
||||
ICONST_0
|
||||
GETSTATIC (INSTANCE, LUser$$serializer;)
|
||||
CHECKCAST
|
||||
INVOKEINTERFACE (kotlinx/serialization/encoding/CompositeDecoder, decodeSerializableElement, (Lkotlinx/serialization/descriptors/SerialDescriptor;ILkotlinx/serialization/DeserializationStrategy;)Ljava/lang/Object;)
|
||||
ALOAD (5)
|
||||
INVOKEINTERFACE (kotlinx/serialization/encoding/CompositeDecoder, decodeSerializableElement, (Lkotlinx/serialization/descriptors/SerialDescriptor;ILkotlinx/serialization/DeserializationStrategy;Ljava/lang/Object;)Ljava/lang/Object;)
|
||||
CHECKCAST
|
||||
ASTORE (5)
|
||||
LDC (2147483647)
|
||||
|
||||
Reference in New Issue
Block a user