Parcelize: Fall back to readValue/writeValue if no other serializers are available
This commit is contained in:
committed by
Yan Zhulanow
parent
8d364a8a1a
commit
f93749ae6a
plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/serializeValue.ir.txt
Vendored
+80
@@ -0,0 +1,80 @@
|
||||
public final class Test$Creator : java/lang/Object, android/os/Parcelable$Creator {
|
||||
public void <init>()
|
||||
|
||||
public final Test createFromParcel(android.os.Parcel parcel) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
LDC (parcel)
|
||||
INVOKESTATIC (kotlin/jvm/internal/Intrinsics, checkNotNullParameter, (Ljava/lang/Object;Ljava/lang/String;)V)
|
||||
NEW
|
||||
DUP
|
||||
ALOAD (1)
|
||||
LDC (LTest;)
|
||||
INVOKEVIRTUAL (java/lang/Class, getClassLoader, ()Ljava/lang/ClassLoader;)
|
||||
INVOKEVIRTUAL (android/os/Parcel, readValue, (Ljava/lang/ClassLoader;)Ljava/lang/Object;)
|
||||
CHECKCAST
|
||||
INVOKESPECIAL (Test, <init>, (LValue;)V)
|
||||
ARETURN
|
||||
LABEL (L1)
|
||||
}
|
||||
|
||||
public java.lang.Object createFromParcel(android.os.Parcel source) {
|
||||
LABEL (L0)
|
||||
ALOAD (0)
|
||||
ALOAD (1)
|
||||
INVOKEVIRTUAL (Test$Creator, createFromParcel, (Landroid/os/Parcel;)LTest;)
|
||||
ARETURN
|
||||
LABEL (L1)
|
||||
}
|
||||
|
||||
public final Test[] newArray(int size)
|
||||
|
||||
public java.lang.Object[] newArray(int size)
|
||||
}
|
||||
|
||||
public final class Test : java/lang/Object, android/os/Parcelable {
|
||||
public final static android.os.Parcelable$Creator CREATOR
|
||||
|
||||
private final Value value
|
||||
|
||||
static void <clinit>() {
|
||||
NEW
|
||||
DUP
|
||||
INVOKESPECIAL (Test$Creator, <init>, ()V)
|
||||
CHECKCAST
|
||||
PUTSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||
RETURN
|
||||
}
|
||||
|
||||
public void <init>(Value value)
|
||||
|
||||
public int describeContents() {
|
||||
LABEL (L0)
|
||||
ICONST_0
|
||||
IRETURN
|
||||
LABEL (L1)
|
||||
}
|
||||
|
||||
public final Value getValue()
|
||||
|
||||
public void writeToParcel(android.os.Parcel out, int flags) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
LDC (out)
|
||||
INVOKESTATIC (kotlin/jvm/internal/Intrinsics, checkNotNullParameter, (Ljava/lang/Object;Ljava/lang/String;)V)
|
||||
ALOAD (1)
|
||||
ALOAD (0)
|
||||
GETFIELD (value, LValue;)
|
||||
INVOKEVIRTUAL (android/os/Parcel, writeValue, (Ljava/lang/Object;)V)
|
||||
RETURN
|
||||
LABEL (L1)
|
||||
}
|
||||
}
|
||||
|
||||
public final class Value : java/lang/Object {
|
||||
private final int x
|
||||
|
||||
public void <init>(int x)
|
||||
|
||||
public final int getX()
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// This test checks that we create calls to readValue/writeValue if there is no other
|
||||
// way of serializing properties. In this case, this would fail at runtime.
|
||||
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>, describeContents
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.android.parcel.*
|
||||
import android.os.Parcelable
|
||||
|
||||
class Value(val x: Int)
|
||||
|
||||
@Parcelize
|
||||
class Test(val value: Value) : Parcelable
|
||||
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
public final class Test$Creator : java/lang/Object, android/os/Parcelable$Creator {
|
||||
public void <init>()
|
||||
|
||||
public final java.lang.Object createFromParcel(android.os.Parcel in) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
LDC (in)
|
||||
INVOKESTATIC (kotlin/jvm/internal/Intrinsics, checkNotNullParameter, (Ljava/lang/Object;Ljava/lang/String;)V)
|
||||
NEW
|
||||
DUP
|
||||
ALOAD (1)
|
||||
LDC (LValue;)
|
||||
INVOKEVIRTUAL (java/lang/Class, getClassLoader, ()Ljava/lang/ClassLoader;)
|
||||
INVOKEVIRTUAL (android/os/Parcel, readValue, (Ljava/lang/ClassLoader;)Ljava/lang/Object;)
|
||||
CHECKCAST
|
||||
INVOKESPECIAL (Test, <init>, (LValue;)V)
|
||||
ARETURN
|
||||
LABEL (L1)
|
||||
}
|
||||
|
||||
public final java.lang.Object[] newArray(int size)
|
||||
}
|
||||
|
||||
public final class Test : java/lang/Object, android/os/Parcelable {
|
||||
public final static android.os.Parcelable$Creator CREATOR
|
||||
|
||||
private final Value value
|
||||
|
||||
static void <clinit>() {
|
||||
NEW
|
||||
DUP
|
||||
INVOKESPECIAL (Test$Creator, <init>, ()V)
|
||||
PUTSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||
RETURN
|
||||
}
|
||||
|
||||
public void <init>(Value value)
|
||||
|
||||
public int describeContents() {
|
||||
LABEL (L0)
|
||||
LDC (0)
|
||||
IRETURN
|
||||
LABEL (L1)
|
||||
}
|
||||
|
||||
public final Value getValue()
|
||||
|
||||
public void writeToParcel(android.os.Parcel parcel, int flags) {
|
||||
LABEL (L0)
|
||||
ALOAD (1)
|
||||
LDC (parcel)
|
||||
INVOKESTATIC (kotlin/jvm/internal/Intrinsics, checkNotNullParameter, (Ljava/lang/Object;Ljava/lang/String;)V)
|
||||
ALOAD (1)
|
||||
ALOAD (0)
|
||||
GETFIELD (value, LValue;)
|
||||
INVOKEVIRTUAL (android/os/Parcel, writeValue, (Ljava/lang/Object;)V)
|
||||
RETURN
|
||||
LABEL (L1)
|
||||
}
|
||||
}
|
||||
|
||||
public final class Value : java/lang/Object {
|
||||
private final int x
|
||||
|
||||
public void <init>(int x)
|
||||
|
||||
public final int getX()
|
||||
}
|
||||
Reference in New Issue
Block a user