IC mangling: Use '_' instead of 'x' as a placeholder before hashing
This commit is contained in:
@@ -17,6 +17,8 @@ import org.jetbrains.kotlin.types.typeUtil.representativeUpperBound
|
||||
import java.security.MessageDigest
|
||||
import java.util.*
|
||||
|
||||
const val NOT_INLINE_CLASS_PARAMETER_PLACEHOLDER = "_"
|
||||
|
||||
fun getManglingSuffixBasedOnKotlinSignature(
|
||||
descriptor: CallableMemberDescriptor,
|
||||
shouldMangleByReturnType: Boolean,
|
||||
@@ -96,7 +98,7 @@ private fun getSignatureElementForMangling(type: KotlinType, useOldManglingRules
|
||||
if (type.isMarkedNullable) append('?')
|
||||
append(';')
|
||||
} else {
|
||||
append('x')
|
||||
append(NOT_INLINE_CLASS_PARAMETER_PLACEHOLDER)
|
||||
}
|
||||
|
||||
is TypeParameterDescriptor -> {
|
||||
|
||||
+4
-2
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.backend.jvm.lower.inlineclasses
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.codegen.state.NOT_INLINE_CLASS_PARAMETER_PLACEHOLDER
|
||||
import org.jetbrains.kotlin.codegen.state.md5base64
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOriginImpl
|
||||
@@ -119,7 +120,8 @@ object InlineClassAbi {
|
||||
// The JVM backend computes mangled names after creating suspend function views, but before default argument
|
||||
// stub insertion. It would be nice if this part of the continuation lowering happened earlier in the pipeline.
|
||||
// TODO: Move suspend function view creation before JvmInlineClassLowering.
|
||||
signatureElementsForMangling += if (useOldMangleRules) "Lkotlin.coroutines.Continuation;" else "x"
|
||||
signatureElementsForMangling += if (useOldMangleRules) "Lkotlin.coroutines.Continuation;"
|
||||
else NOT_INLINE_CLASS_PARAMETER_PLACEHOLDER
|
||||
}
|
||||
val signatureString = signatureElementsForMangling.joinToString() +
|
||||
if (mangleReturnTypes && irFunction.hasMangledReturnType && !useOldMangleRules)
|
||||
@@ -144,7 +146,7 @@ object InlineClassAbi {
|
||||
append(erasedUpperBound.fqNameWhenAvailable!!)
|
||||
if (isNullable()) append('?')
|
||||
append(';')
|
||||
} else "x"
|
||||
} else NOT_INLINE_CLASS_PARAMETER_PLACEHOLDER
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -22,7 +22,7 @@ public final class InlineList {
|
||||
public synthetic method add(p0: int, p1: java.lang.Object): void
|
||||
public synthetic method add(p0: java.lang.Object): boolean
|
||||
public method add-jHY5zpA(p0: int): boolean
|
||||
public method add-rENGgLQ(p0: int, p1: int): void
|
||||
public method add-paNdoDA(p0: int, p1: int): void
|
||||
public method addAll(p0: int, p1: java.util.Collection): boolean
|
||||
public method addAll(p0: java.util.Collection): boolean
|
||||
public synthetic final static method box-impl(p0: java.util.List): InlineList
|
||||
@@ -37,8 +37,8 @@ public final class InlineList {
|
||||
public static method equals-impl(p0: java.util.List, p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: java.util.List, p1: java.util.List): boolean
|
||||
public synthetic bridge method get(p0: int): java.lang.Object
|
||||
public method get-JnfgTak(p0: int): int
|
||||
public static method get-JnfgTak(p0: java.util.List, p1: int): int
|
||||
public method get-7aQB58E(p0: int): int
|
||||
public static method get-7aQB58E(p0: java.util.List, p1: int): int
|
||||
public method getSize(): int
|
||||
public static method getSize-impl(p0: java.util.List): int
|
||||
public method hashCode(): int
|
||||
@@ -63,7 +63,7 @@ public final class InlineList {
|
||||
public method removeAll(p0: java.util.Collection): boolean
|
||||
public method retainAll(p0: java.util.Collection): boolean
|
||||
public synthetic method set(p0: int, p1: java.lang.Object): java.lang.Object
|
||||
public method set-Geu8JnU(p0: int, p1: int): int
|
||||
public method set-_wdf3hM(p0: int, p1: int): int
|
||||
public bridge final method size(): int
|
||||
public method subList(p0: int, p1: int): java.util.List
|
||||
public static method subList-impl(p0: java.util.List, p1: int, p2: int): java.util.List
|
||||
|
||||
Vendored
+4
-4
@@ -22,7 +22,7 @@ public final class InlineList {
|
||||
public synthetic bridge method add(p0: int, p1: java.lang.Object): void
|
||||
public synthetic bridge method add(p0: java.lang.Object): boolean
|
||||
public method add-jHY5zpA(p0: int): boolean
|
||||
public method add-rENGgLQ(p0: int, p1: int): void
|
||||
public method add-paNdoDA(p0: int, p1: int): void
|
||||
public method addAll(p0: int, p1: java.util.Collection): boolean
|
||||
public method addAll(p0: java.util.Collection): boolean
|
||||
public synthetic final static method box-impl(p0: java.util.List): InlineList
|
||||
@@ -37,8 +37,8 @@ public final class InlineList {
|
||||
public static method equals-impl(p0: java.util.List, p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: java.util.List, p1: java.util.List): boolean
|
||||
public synthetic bridge method get(p0: int): java.lang.Object
|
||||
public method get-JnfgTak(p0: int): int
|
||||
public static method get-JnfgTak(p0: java.util.List, p1: int): int
|
||||
public method get-7aQB58E(p0: int): int
|
||||
public static method get-7aQB58E(p0: java.util.List, p1: int): int
|
||||
public method getSize(): int
|
||||
public static method getSize-impl(p0: java.util.List): int
|
||||
public method hashCode(): int
|
||||
@@ -63,7 +63,7 @@ public final class InlineList {
|
||||
public method removeAll(p0: java.util.Collection): boolean
|
||||
public method retainAll(p0: java.util.Collection): boolean
|
||||
public synthetic bridge method set(p0: int, p1: java.lang.Object): java.lang.Object
|
||||
public method set-Geu8JnU(p0: int, p1: int): int
|
||||
public method set-_wdf3hM(p0: int, p1: int): int
|
||||
public synthetic bridge method size(): int
|
||||
public method subList(p0: int, p1: int): java.util.List
|
||||
public static method subList-impl(p0: java.util.List, p1: int, p2: int): java.util.List
|
||||
|
||||
Vendored
+1
-1
@@ -70,7 +70,7 @@ public final class InlineMap {
|
||||
public method putAll(p0: java.util.Map): void
|
||||
public bridge final method remove(p0: java.lang.Object): IV
|
||||
public synthetic bridge method remove(p0: java.lang.Object): java.lang.Object
|
||||
public method remove-Ilea9M0(p0: java.lang.Object): IV
|
||||
public method remove-TbaaF6U(p0: java.lang.Object): IV
|
||||
public synthetic bridge method size(): int
|
||||
public method toString(): java.lang.String
|
||||
public static method toString-impl(p0: java.util.Map): java.lang.String
|
||||
|
||||
+8
-8
@@ -23,8 +23,8 @@ public final class InlineMutableList {
|
||||
public synthetic bridge method add(p0: java.lang.Object): boolean
|
||||
public static method add-jHY5zpA(p0: java.util.List, p1: long): boolean
|
||||
public method add-jHY5zpA(p0: long): boolean
|
||||
public method add-rENGgLQ(p0: int, p1: long): void
|
||||
public static method add-rENGgLQ(p0: java.util.List, p1: int, p2: long): void
|
||||
public method add-paNdoDA(p0: int, p1: long): void
|
||||
public static method add-paNdoDA(p0: java.util.List, p1: int, p2: long): void
|
||||
public method addAll(p0: int, p1: java.util.Collection): boolean
|
||||
public method addAll(p0: java.util.Collection): boolean
|
||||
public static method addAll-impl(p0: java.util.List, p1: int, p2: java.util.Collection): boolean
|
||||
@@ -42,8 +42,8 @@ public final class InlineMutableList {
|
||||
public static method equals-impl(p0: java.util.List, p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: java.util.List, p1: java.util.List): boolean
|
||||
public synthetic bridge method get(p0: int): java.lang.Object
|
||||
public method get-JnfgTak(p0: int): long
|
||||
public static method get-JnfgTak(p0: java.util.List, p1: int): long
|
||||
public method get-7aQB58E(p0: int): long
|
||||
public static method get-7aQB58E(p0: java.util.List, p1: int): long
|
||||
public method getSize(): int
|
||||
public static method getSize-impl(p0: java.util.List): int
|
||||
public method hashCode(): int
|
||||
@@ -69,13 +69,13 @@ public final class InlineMutableList {
|
||||
public method remove-jHY5zpA(p0: long): boolean
|
||||
public method removeAll(p0: java.util.Collection): boolean
|
||||
public static method removeAll-impl(p0: java.util.List, p1: java.util.Collection): boolean
|
||||
public method removeAt-JnfgTak(p0: int): long
|
||||
public static method removeAt-JnfgTak(p0: java.util.List, p1: int): long
|
||||
public method removeAt-7aQB58E(p0: int): long
|
||||
public static method removeAt-7aQB58E(p0: java.util.List, p1: int): long
|
||||
public method retainAll(p0: java.util.Collection): boolean
|
||||
public static method retainAll-impl(p0: java.util.List, p1: java.util.Collection): boolean
|
||||
public synthetic bridge method set(p0: int, p1: java.lang.Object): java.lang.Object
|
||||
public method set-Geu8JnU(p0: int, p1: long): long
|
||||
public static method set-Geu8JnU(p0: java.util.List, p1: int, p2: long): long
|
||||
public method set-_wdf3hM(p0: int, p1: long): long
|
||||
public static method set-_wdf3hM(p0: java.util.List, p1: int, p2: long): long
|
||||
public bridge final method size(): int
|
||||
public method subList(p0: int, p1: int): java.util.List
|
||||
public static method subList-impl(p0: java.util.List, p1: int, p2: int): java.util.List
|
||||
|
||||
+8
-8
@@ -23,8 +23,8 @@ public final class InlineMutableList {
|
||||
public synthetic bridge method add(p0: java.lang.Object): boolean
|
||||
public static method add-jHY5zpA(p0: java.util.List, p1: long): boolean
|
||||
public method add-jHY5zpA(p0: long): boolean
|
||||
public method add-rENGgLQ(p0: int, p1: long): void
|
||||
public static method add-rENGgLQ(p0: java.util.List, p1: int, p2: long): void
|
||||
public method add-paNdoDA(p0: int, p1: long): void
|
||||
public static method add-paNdoDA(p0: java.util.List, p1: int, p2: long): void
|
||||
public method addAll(p0: int, p1: java.util.Collection): boolean
|
||||
public method addAll(p0: java.util.Collection): boolean
|
||||
public static method addAll-impl(p0: java.util.List, p1: int, p2: java.util.Collection): boolean
|
||||
@@ -42,8 +42,8 @@ public final class InlineMutableList {
|
||||
public static method equals-impl(p0: java.util.List, p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: java.util.List, p1: java.util.List): boolean
|
||||
public synthetic bridge method get(p0: int): java.lang.Object
|
||||
public method get-JnfgTak(p0: int): long
|
||||
public static method get-JnfgTak(p0: java.util.List, p1: int): long
|
||||
public method get-7aQB58E(p0: int): long
|
||||
public static method get-7aQB58E(p0: java.util.List, p1: int): long
|
||||
public method getSize(): int
|
||||
public static method getSize-impl(p0: java.util.List): int
|
||||
public method hashCode(): int
|
||||
@@ -69,13 +69,13 @@ public final class InlineMutableList {
|
||||
public method remove-jHY5zpA(p0: long): boolean
|
||||
public method removeAll(p0: java.util.Collection): boolean
|
||||
public static method removeAll-impl(p0: java.util.List, p1: java.util.Collection): boolean
|
||||
public method removeAt-JnfgTak(p0: int): long
|
||||
public static method removeAt-JnfgTak(p0: java.util.List, p1: int): long
|
||||
public method removeAt-7aQB58E(p0: int): long
|
||||
public static method removeAt-7aQB58E(p0: java.util.List, p1: int): long
|
||||
public method retainAll(p0: java.util.Collection): boolean
|
||||
public static method retainAll-impl(p0: java.util.List, p1: java.util.Collection): boolean
|
||||
public synthetic bridge method set(p0: int, p1: java.lang.Object): java.lang.Object
|
||||
public method set-Geu8JnU(p0: int, p1: long): long
|
||||
public static method set-Geu8JnU(p0: java.util.List, p1: int, p2: long): long
|
||||
public method set-_wdf3hM(p0: int, p1: long): long
|
||||
public static method set-_wdf3hM(p0: java.util.List, p1: int, p2: long): long
|
||||
public synthetic bridge method size(): int
|
||||
public method subList(p0: int, p1: int): java.util.List
|
||||
public static method subList-impl(p0: java.util.List, p1: int, p2: int): java.util.List
|
||||
|
||||
+2
-2
@@ -19,6 +19,6 @@ public final class IC {
|
||||
@kotlin.Metadata
|
||||
public final class NullableAndNotNullPrimitiveKt {
|
||||
// source: 'nullableAndNotNullPrimitive.kt'
|
||||
public final static method foo-MSgPiiU(@org.jetbrains.annotations.Nullable p0: java.lang.Integer, p1: int): void
|
||||
public final static method foo-MSgPiiU(p0: int, p1: int): void
|
||||
public final static method foo-3XBUs8U(@org.jetbrains.annotations.Nullable p0: java.lang.Integer, p1: int): void
|
||||
public final static method foo-3XBUs8U(p0: int, p1: int): void
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ public final class A {
|
||||
@kotlin.Metadata
|
||||
public interface I {
|
||||
// source: 'kt42879.kt'
|
||||
public abstract method compute-WzO2ekY(p0: int): int
|
||||
public abstract method compute-p71pxCs(p0: int): int
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@@ -30,7 +30,7 @@ final class Kt42879Kt$g$1 {
|
||||
inner (anonymous) class Kt42879Kt$g$1
|
||||
static method <clinit>(): void
|
||||
method <init>(): void
|
||||
public final method compute-WzO2ekY(p0: int): int
|
||||
public final method compute-p71pxCs(p0: int): int
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
|
||||
+1
-1
@@ -18,6 +18,6 @@ class B : A {
|
||||
override val i by Delegate()
|
||||
}
|
||||
|
||||
// 1 public final getValue-Y6jMyTM\(Ljava/lang/Object;Lkotlin/reflect/KProperty;\)I
|
||||
// 1 public final getValue-BwmXtik\(Ljava/lang/Object;Lkotlin/reflect/KProperty;\)I
|
||||
// 1 public getI-lPtA-2M\(\)I
|
||||
// 1 public abstract getI-lPtA-2M\(\)I
|
||||
|
||||
+1
-1
@@ -28,6 +28,6 @@ inline class Delegate(val default: Int) {
|
||||
// 0 DelegateFactory\.unbox
|
||||
// 0 Delegate\.box
|
||||
// 0 Delegate\.unbox
|
||||
// 1 INVOKESTATIC DelegateFactory\.provideDelegate-gy51yk8 \(ILjava/lang/Object;Ljava/lang/Object;\)I
|
||||
// 1 INVOKESTATIC DelegateFactory\.provideDelegate-RDSKdTE \(ILjava/lang/Object;Ljava/lang/Object;\)I
|
||||
// 1 INVOKESTATIC Delegate\.getValue-impl \(ILjava/lang/Object;Ljava/lang/Object;\)I
|
||||
// 1 INVOKESTATIC Delegate\.setValue-impl \(ILjava/lang/Object;Ljava/lang/Object;I\)V
|
||||
+4
-4
@@ -13,7 +13,7 @@ suspend fun bar(p: P) {}
|
||||
// The mangled name for a suspend function includes the continuation parameter in the hash computation, but not the
|
||||
// default argument mask and handler.
|
||||
|
||||
// 1 public final static foo-opU5HYo\(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
|
||||
// 1 public static synthetic foo-opU5HYo\$default\(ILkotlin/coroutines/Continuation;ILjava/lang/Object;\)Ljava/lang/Object;
|
||||
// 1 INVOKESTATIC a/TestKt.foo-opU5HYo \(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
|
||||
// 1 public final static bar-opU5HYo\(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
|
||||
// 1 public final static foo-_K3kcpY\(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
|
||||
// 1 public static synthetic foo-_K3kcpY\$default\(ILkotlin/coroutines/Continuation;ILjava/lang/Object;\)Ljava/lang/Object;
|
||||
// 1 INVOKESTATIC a/TestKt.foo-_K3kcpY \(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
|
||||
// 1 public final static bar-_K3kcpY\(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
|
||||
@@ -22,6 +22,6 @@ inline class SomeClass(val v: Int) {
|
||||
// jvm signature: (ILjava/lang/Object;)Ljava/lang/Object;
|
||||
// generic signature: <K:Ljava/lang/Object;>(ITK;)TK;
|
||||
|
||||
// method: SomeClass$Companion::comp-aew-wRw
|
||||
// method: SomeClass$Companion::comp-TwaN_yk
|
||||
// jvm signature: (ILjava/lang/Object;)Ljava/lang/Object;
|
||||
// generic signature: <T:Ljava/lang/Object;>(ITT;)TT;
|
||||
Vendored
+1
-1
@@ -21,6 +21,6 @@ object Test {
|
||||
// jvm signature: (I)V
|
||||
// generic signature: null
|
||||
|
||||
// method: Test::asAll-wqC9CcI
|
||||
// method: Test::asAll-ZcpZUGQ
|
||||
// jvm signature: (ILjava/lang/Object;II)I
|
||||
// generic signature: null
|
||||
|
||||
Reference in New Issue
Block a user