Parcelize: Add a test for efficient Parcelable serialization within the same module
This commit is contained in:
committed by
Alexander Udalov
parent
a4e6dbb0d7
commit
518c7a32b8
+5
@@ -64,6 +64,11 @@ public class ParcelBytecodeListingTestGenerated extends AbstractParcelBytecodeLi
|
|||||||
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/duplicatingClinit.kt");
|
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/duplicatingClinit.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("efficientParcelable.kt")
|
||||||
|
public void testEfficientParcelable() throws Exception {
|
||||||
|
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/efficientParcelable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("IBinderIInterface.kt")
|
@TestMetadata("IBinderIInterface.kt")
|
||||||
public void testIBinderIInterface() throws Exception {
|
public void testIBinderIInterface() throws Exception {
|
||||||
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/IBinderIInterface.kt");
|
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/IBinderIInterface.kt");
|
||||||
|
|||||||
+5
@@ -64,6 +64,11 @@ public class ParcelIrBytecodeListingTestGenerated extends AbstractParcelIrByteco
|
|||||||
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/duplicatingClinit.kt");
|
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/duplicatingClinit.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("efficientParcelable.kt")
|
||||||
|
public void testEfficientParcelable() throws Exception {
|
||||||
|
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/efficientParcelable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("IBinderIInterface.kt")
|
@TestMetadata("IBinderIInterface.kt")
|
||||||
public void testIBinderIInterface() throws Exception {
|
public void testIBinderIInterface() throws Exception {
|
||||||
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/IBinderIInterface.kt");
|
runTest("plugins/android-extensions/android-extensions-compiler/testData/parcel/codegen/IBinderIInterface.kt");
|
||||||
|
|||||||
+156
@@ -0,0 +1,156 @@
|
|||||||
|
public final class test/Bar$Creator : java/lang/Object, android/os/Parcelable$Creator {
|
||||||
|
public void <init>()
|
||||||
|
|
||||||
|
public final test.Bar createFromParcel(android.os.Parcel parcel) {
|
||||||
|
LABEL (L0)
|
||||||
|
ALOAD (1)
|
||||||
|
LDC (parcel)
|
||||||
|
INVOKESTATIC (kotlin/jvm/internal/Intrinsics, checkNotNullParameter, (Ljava/lang/Object;Ljava/lang/String;)V)
|
||||||
|
LABEL (L1)
|
||||||
|
NEW
|
||||||
|
DUP
|
||||||
|
ALOAD (1)
|
||||||
|
INVOKEVIRTUAL (android/os/Parcel, readInt, ()I)
|
||||||
|
IFNE (L2)
|
||||||
|
ACONST_NULL
|
||||||
|
GOTO (L3)
|
||||||
|
LABEL (L2)
|
||||||
|
GETSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||||
|
ALOAD (1)
|
||||||
|
INVOKEINTERFACE (android/os/Parcelable$Creator, createFromParcel, (Landroid/os/Parcel;)Ljava/lang/Object;)
|
||||||
|
LABEL (L3)
|
||||||
|
CHECKCAST
|
||||||
|
INVOKESPECIAL (test/Bar, <init>, (Ltest/Foo;)V)
|
||||||
|
ARETURN
|
||||||
|
LABEL (L4)
|
||||||
|
}
|
||||||
|
|
||||||
|
public java.lang.Object createFromParcel(android.os.Parcel source) {
|
||||||
|
LABEL (L0)
|
||||||
|
ALOAD (0)
|
||||||
|
ALOAD (1)
|
||||||
|
INVOKEVIRTUAL (test/Bar$Creator, createFromParcel, (Landroid/os/Parcel;)Ltest/Bar;)
|
||||||
|
ARETURN
|
||||||
|
LABEL (L1)
|
||||||
|
}
|
||||||
|
|
||||||
|
public final test.Bar[] newArray(int size)
|
||||||
|
|
||||||
|
public java.lang.Object[] newArray(int size)
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class test/Bar : java/lang/Object, android/os/Parcelable {
|
||||||
|
public final static android.os.Parcelable$Creator CREATOR
|
||||||
|
|
||||||
|
private final test.Foo foo
|
||||||
|
|
||||||
|
static void <clinit>() {
|
||||||
|
NEW
|
||||||
|
DUP
|
||||||
|
INVOKESPECIAL (test/Bar$Creator, <init>, ()V)
|
||||||
|
CHECKCAST
|
||||||
|
PUTSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||||
|
RETURN
|
||||||
|
}
|
||||||
|
|
||||||
|
public void <init>(test.Foo foo)
|
||||||
|
|
||||||
|
public int describeContents()
|
||||||
|
|
||||||
|
public final test.Foo getFoo()
|
||||||
|
|
||||||
|
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 (0)
|
||||||
|
GETFIELD (foo, Ltest/Foo;)
|
||||||
|
ASTORE (3)
|
||||||
|
ALOAD (3)
|
||||||
|
IFNONNULL (L1)
|
||||||
|
ALOAD (1)
|
||||||
|
ICONST_0
|
||||||
|
INVOKEVIRTUAL (android/os/Parcel, writeInt, (I)V)
|
||||||
|
GOTO (L2)
|
||||||
|
LABEL (L1)
|
||||||
|
ALOAD (1)
|
||||||
|
ICONST_1
|
||||||
|
INVOKEVIRTUAL (android/os/Parcel, writeInt, (I)V)
|
||||||
|
ALOAD (3)
|
||||||
|
ALOAD (1)
|
||||||
|
ILOAD (2)
|
||||||
|
INVOKEVIRTUAL (test/Foo, writeToParcel, (Landroid/os/Parcel;I)V)
|
||||||
|
LABEL (L2)
|
||||||
|
RETURN
|
||||||
|
LABEL (L3)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class test/Foo$Creator : java/lang/Object, android/os/Parcelable$Creator {
|
||||||
|
public void <init>()
|
||||||
|
|
||||||
|
public final test.Foo 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
|
||||||
|
GETSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||||
|
ALOAD (1)
|
||||||
|
INVOKEINTERFACE (android/os/Parcelable$Creator, createFromParcel, (Landroid/os/Parcel;)Ljava/lang/Object;)
|
||||||
|
CHECKCAST
|
||||||
|
INVOKESPECIAL (test/Foo, <init>, (Ltest/Bar;)V)
|
||||||
|
ARETURN
|
||||||
|
LABEL (L1)
|
||||||
|
}
|
||||||
|
|
||||||
|
public java.lang.Object createFromParcel(android.os.Parcel source) {
|
||||||
|
LABEL (L0)
|
||||||
|
ALOAD (0)
|
||||||
|
ALOAD (1)
|
||||||
|
INVOKEVIRTUAL (test/Foo$Creator, createFromParcel, (Landroid/os/Parcel;)Ltest/Foo;)
|
||||||
|
ARETURN
|
||||||
|
LABEL (L1)
|
||||||
|
}
|
||||||
|
|
||||||
|
public final test.Foo[] newArray(int size)
|
||||||
|
|
||||||
|
public java.lang.Object[] newArray(int size)
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class test/Foo : java/lang/Object, android/os/Parcelable {
|
||||||
|
public final static android.os.Parcelable$Creator CREATOR
|
||||||
|
|
||||||
|
private final test.Bar bar
|
||||||
|
|
||||||
|
static void <clinit>() {
|
||||||
|
NEW
|
||||||
|
DUP
|
||||||
|
INVOKESPECIAL (test/Foo$Creator, <init>, ()V)
|
||||||
|
CHECKCAST
|
||||||
|
PUTSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||||
|
RETURN
|
||||||
|
}
|
||||||
|
|
||||||
|
public void <init>(test.Bar bar)
|
||||||
|
|
||||||
|
public int describeContents()
|
||||||
|
|
||||||
|
public final test.Bar getBar()
|
||||||
|
|
||||||
|
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 (0)
|
||||||
|
GETFIELD (bar, Ltest/Bar;)
|
||||||
|
ALOAD (1)
|
||||||
|
ILOAD (2)
|
||||||
|
INVOKEVIRTUAL (test/Bar, writeToParcel, (Landroid/os/Parcel;I)V)
|
||||||
|
RETURN
|
||||||
|
LABEL (L1)
|
||||||
|
}
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>
|
||||||
|
// WITH_RUNTIME
|
||||||
|
//FILE: test.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
import kotlinx.android.parcel.*
|
||||||
|
import android.os.Parcelable
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
class Foo(val bar: Bar): Parcelable
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
class Bar(val foo: Foo?) : Parcelable
|
||||||
+134
@@ -0,0 +1,134 @@
|
|||||||
|
public final class test/Bar$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)
|
||||||
|
LABEL (L1)
|
||||||
|
NEW
|
||||||
|
DUP
|
||||||
|
ALOAD (1)
|
||||||
|
INVOKEVIRTUAL (android/os/Parcel, readInt, ()I)
|
||||||
|
IFEQ (L2)
|
||||||
|
ALOAD (1)
|
||||||
|
GETSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||||
|
SWAP
|
||||||
|
INVOKEINTERFACE (android/os/Parcelable$Creator, createFromParcel, (Landroid/os/Parcel;)Ljava/lang/Object;)
|
||||||
|
CHECKCAST
|
||||||
|
GOTO (L3)
|
||||||
|
LABEL (L2)
|
||||||
|
ACONST_NULL
|
||||||
|
LABEL (L3)
|
||||||
|
INVOKESPECIAL (test/Bar, <init>, (Ltest/Foo;)V)
|
||||||
|
ARETURN
|
||||||
|
LABEL (L4)
|
||||||
|
}
|
||||||
|
|
||||||
|
public final java.lang.Object[] newArray(int size)
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class test/Bar : java/lang/Object, android/os/Parcelable {
|
||||||
|
public final static android.os.Parcelable$Creator CREATOR
|
||||||
|
|
||||||
|
private final test.Foo foo
|
||||||
|
|
||||||
|
static void <clinit>() {
|
||||||
|
NEW
|
||||||
|
DUP
|
||||||
|
INVOKESPECIAL (test/Bar$Creator, <init>, ()V)
|
||||||
|
PUTSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||||
|
RETURN
|
||||||
|
}
|
||||||
|
|
||||||
|
public void <init>(test.Foo foo)
|
||||||
|
|
||||||
|
public int describeContents()
|
||||||
|
|
||||||
|
public final test.Foo getFoo()
|
||||||
|
|
||||||
|
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 (foo, Ltest/Foo;)
|
||||||
|
DUP
|
||||||
|
IFNULL (L1)
|
||||||
|
ALOAD (1)
|
||||||
|
LDC (1)
|
||||||
|
INVOKEVIRTUAL (android/os/Parcel, writeInt, (I)V)
|
||||||
|
SWAP
|
||||||
|
LDC (0)
|
||||||
|
INVOKEINTERFACE (android/os/Parcelable, writeToParcel, (Landroid/os/Parcel;I)V)
|
||||||
|
GOTO (L2)
|
||||||
|
LABEL (L1)
|
||||||
|
POP
|
||||||
|
LDC (0)
|
||||||
|
INVOKEVIRTUAL (android/os/Parcel, writeInt, (I)V)
|
||||||
|
LABEL (L2)
|
||||||
|
RETURN
|
||||||
|
LABEL (L3)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class test/Foo$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)
|
||||||
|
GETSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||||
|
SWAP
|
||||||
|
INVOKEINTERFACE (android/os/Parcelable$Creator, createFromParcel, (Landroid/os/Parcel;)Ljava/lang/Object;)
|
||||||
|
CHECKCAST
|
||||||
|
INVOKESPECIAL (test/Foo, <init>, (Ltest/Bar;)V)
|
||||||
|
ARETURN
|
||||||
|
LABEL (L1)
|
||||||
|
}
|
||||||
|
|
||||||
|
public final java.lang.Object[] newArray(int size)
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class test/Foo : java/lang/Object, android/os/Parcelable {
|
||||||
|
public final static android.os.Parcelable$Creator CREATOR
|
||||||
|
|
||||||
|
private final test.Bar bar
|
||||||
|
|
||||||
|
static void <clinit>() {
|
||||||
|
NEW
|
||||||
|
DUP
|
||||||
|
INVOKESPECIAL (test/Foo$Creator, <init>, ()V)
|
||||||
|
PUTSTATIC (CREATOR, Landroid/os/Parcelable$Creator;)
|
||||||
|
RETURN
|
||||||
|
}
|
||||||
|
|
||||||
|
public void <init>(test.Bar bar)
|
||||||
|
|
||||||
|
public int describeContents()
|
||||||
|
|
||||||
|
public final test.Bar getBar()
|
||||||
|
|
||||||
|
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 (bar, Ltest/Bar;)
|
||||||
|
SWAP
|
||||||
|
LDC (0)
|
||||||
|
INVOKEINTERFACE (android/os/Parcelable, writeToParcel, (Landroid/os/Parcel;I)V)
|
||||||
|
RETURN
|
||||||
|
LABEL (L1)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user