forked from JetBrains/kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Parcelize] Make sure that kotlin.uuid.Uuid uses parcelize generation…
… and not Serializable Merge-request: KOTLIN-MR-1340 Merged-by: Rafał Galczak <[email protected]>
- Loading branch information
Showing
6 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
plugins/parcelize/parcelize-compiler/testData/codegen/uuid.asm.fir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
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 (Test) | ||
DUP | ||
GETSTATIC (kotlin/uuid/Uuid, Companion, Lkotlin/uuid/Uuid$Companion;) | ||
ALOAD (1) | ||
INVOKEVIRTUAL (android/os/Parcel, readLong, ()J) | ||
ALOAD (1) | ||
INVOKEVIRTUAL (android/os/Parcel, readLong, ()J) | ||
INVOKEVIRTUAL (kotlin/uuid/Uuid$Companion, fromLongs, (JJ)Lkotlin/uuid/Uuid;) | ||
INVOKESPECIAL (Test, <init>, (Lkotlin/uuid/Uuid;)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 kotlin.uuid.Uuid uuidData | ||
|
||
static void <clinit>() | ||
|
||
public void <init>(kotlin.uuid.Uuid uuidData) | ||
|
||
public final kotlin.uuid.Uuid component1() | ||
|
||
public final Test copy(kotlin.uuid.Uuid uuidData) | ||
|
||
public static Test copy$default(Test p0, kotlin.uuid.Uuid p1, int p2, java.lang.Object p3) | ||
|
||
public final int describeContents() | ||
|
||
public boolean equals(java.lang.Object other) | ||
|
||
public final kotlin.uuid.Uuid getUuidData() | ||
|
||
public int hashCode() | ||
|
||
public java.lang.String toString() | ||
|
||
public final void writeToParcel(android.os.Parcel dest, int flags) { | ||
LABEL (L0) | ||
ALOAD (1) | ||
LDC (dest) | ||
INVOKESTATIC (kotlin/jvm/internal/Intrinsics, checkNotNullParameter, (Ljava/lang/Object;Ljava/lang/String;)V) | ||
ALOAD (0) | ||
GETFIELD (Test, uuidData, Lkotlin/uuid/Uuid;) | ||
ASTORE (3) | ||
ALOAD (3) | ||
INVOKEVIRTUAL (kotlin/uuid/Uuid, getMostSignificantBits, ()J) | ||
ALOAD (3) | ||
INVOKEVIRTUAL (kotlin/uuid/Uuid, getLeastSignificantBits, ()J) | ||
LSTORE (4) | ||
LSTORE (6) | ||
LABEL (L1) | ||
ICONST_0 | ||
ISTORE (8) | ||
LABEL (L2) | ||
ALOAD (1) | ||
LLOAD (6) | ||
INVOKEVIRTUAL (android/os/Parcel, writeLong, (J)V) | ||
ALOAD (1) | ||
LLOAD (4) | ||
INVOKEVIRTUAL (android/os/Parcel, writeLong, (J)V) | ||
LABEL (L3) | ||
LINENUMBER (13) | ||
RETURN | ||
LABEL (L4) | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
plugins/parcelize/parcelize-compiler/testData/codegen/uuid.asm.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
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 (Test) | ||
DUP | ||
GETSTATIC (kotlin/uuid/Uuid, Companion, Lkotlin/uuid/Uuid$Companion;) | ||
ALOAD (1) | ||
INVOKEVIRTUAL (android/os/Parcel, readLong, ()J) | ||
ALOAD (1) | ||
INVOKEVIRTUAL (android/os/Parcel, readLong, ()J) | ||
INVOKEVIRTUAL (kotlin/uuid/Uuid$Companion, fromLongs, (JJ)Lkotlin/uuid/Uuid;) | ||
INVOKESPECIAL (Test, <init>, (Lkotlin/uuid/Uuid;)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 kotlin.uuid.Uuid uuidData | ||
|
||
static void <clinit>() | ||
|
||
public void <init>(kotlin.uuid.Uuid uuidData) | ||
|
||
public final kotlin.uuid.Uuid component1() | ||
|
||
public final Test copy(kotlin.uuid.Uuid uuidData) | ||
|
||
public static Test copy$default(Test p0, kotlin.uuid.Uuid p1, int p2, java.lang.Object p3) | ||
|
||
public int describeContents() | ||
|
||
public boolean equals(java.lang.Object other) | ||
|
||
public final kotlin.uuid.Uuid getUuidData() | ||
|
||
public int hashCode() | ||
|
||
public java.lang.String toString() | ||
|
||
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 (Test, uuidData, Lkotlin/uuid/Uuid;) | ||
ASTORE (3) | ||
ALOAD (3) | ||
INVOKEVIRTUAL (kotlin/uuid/Uuid, getMostSignificantBits, ()J) | ||
ALOAD (3) | ||
INVOKEVIRTUAL (kotlin/uuid/Uuid, getLeastSignificantBits, ()J) | ||
LSTORE (4) | ||
LSTORE (6) | ||
LABEL (L1) | ||
ICONST_0 | ||
ISTORE (8) | ||
LABEL (L2) | ||
ALOAD (1) | ||
LLOAD (6) | ||
INVOKEVIRTUAL (android/os/Parcel, writeLong, (J)V) | ||
ALOAD (1) | ||
LLOAD (4) | ||
INVOKEVIRTUAL (android/os/Parcel, writeLong, (J)V) | ||
LABEL (L3) | ||
RETURN | ||
LABEL (L4) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
plugins/parcelize/parcelize-compiler/testData/codegen/uuid.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// CURIOUS_ABOUT: writeToParcel, createFromParcel | ||
// WITH_STDLIB | ||
|
||
@file:OptIn(kotlin.uuid.ExperimentalUuidApi::class) | ||
|
||
import kotlinx.parcelize.* | ||
import android.os.Parcelable | ||
import kotlin.uuid.Uuid | ||
|
||
@Parcelize | ||
data class Test( | ||
val uuidData: Uuid, | ||
) : Parcelable |
6 changes: 6 additions & 0 deletions
6
...org/jetbrains/kotlin/parcelize/test/runners/FirParcelizeBytecodeListingTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
.../org/jetbrains/kotlin/parcelize/test/runners/ParcelizeIrBytecodeListingTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.