IC mangling: Use empty list as a separator in the new mangling scheme
This commit is contained in:
@@ -76,7 +76,7 @@ fun getManglingSuffixBasedOnKotlinSignature(
|
||||
|
||||
private fun collectSignatureForMangling(descriptor: CallableMemberDescriptor, useOldManglingRules: Boolean): String {
|
||||
val types = listOfNotNull(descriptor.extensionReceiverParameter?.type) + descriptor.valueParameters.map { it.type }
|
||||
return types.joinToString { getSignatureElementForMangling(it, useOldManglingRules) }
|
||||
return types.joinToString(separator = if (useOldManglingRules) ", " else "") { getSignatureElementForMangling(it, useOldManglingRules) }
|
||||
}
|
||||
|
||||
private fun getSignatureElementForMangling(type: KotlinType, useOldManglingRules: Boolean): String = buildString {
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.codegen.AsmUtil
|
||||
import org.jetbrains.kotlin.codegen.FrameMapBase
|
||||
import org.jetbrains.kotlin.codegen.OwnerKind
|
||||
import org.jetbrains.kotlin.codegen.SourceInfo
|
||||
import org.jetbrains.kotlin.codegen.classFileContainsMethod
|
||||
import org.jetbrains.kotlin.codegen.inline.SourceMapper
|
||||
import org.jetbrains.kotlin.codegen.signature.BothSignatureWriter
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ object InlineClassAbi {
|
||||
signatureElementsForMangling += if (useOldMangleRules) "Lkotlin.coroutines.Continuation;"
|
||||
else NOT_INLINE_CLASS_PARAMETER_PLACEHOLDER
|
||||
}
|
||||
val signatureString = signatureElementsForMangling.joinToString() +
|
||||
val signatureString = signatureElementsForMangling.joinToString(separator = if (useOldMangleRules) ", " else "") +
|
||||
if (mangleReturnTypes && irFunction.hasMangledReturnType && !useOldMangleRules)
|
||||
":${irFunction.returnType.eraseToString(useOldMangleRules)}" else ""
|
||||
return md5base64(signatureString)
|
||||
|
||||
Vendored
+2
-2
@@ -21,8 +21,8 @@ public final class InlineList {
|
||||
private synthetic method <init>(p0: java.util.List): void
|
||||
public synthetic method add(p0: int, p1: java.lang.Object): void
|
||||
public synthetic method add(p0: java.lang.Object): boolean
|
||||
public method add--AyYFnU(p0: int, p1: int): void
|
||||
public method add-jHY5zpA(p0: int): boolean
|
||||
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
|
||||
@@ -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-_wdf3hM(p0: int, p1: int): int
|
||||
public method set-kAA0daY(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
+2
-2
@@ -21,8 +21,8 @@ public final class InlineList {
|
||||
private synthetic method <init>(p0: java.util.List): void
|
||||
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--AyYFnU(p0: int, p1: int): void
|
||||
public method add-jHY5zpA(p0: int): boolean
|
||||
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
|
||||
@@ -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-_wdf3hM(p0: int, p1: int): int
|
||||
public method set-kAA0daY(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
@@ -66,7 +66,7 @@ public final class InlineMap {
|
||||
public static method isEmpty-impl(p0: java.util.Map): boolean
|
||||
public bridge final method keySet(): java.util.Set
|
||||
public synthetic method put(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
|
||||
public method put-eSoqwEg(p0: int, p1: double): IV
|
||||
public method put-t80dRTo(p0: int, p1: double): IV
|
||||
public method putAll(p0: java.util.Map): void
|
||||
public method remove(p0: java.lang.Object): java.lang.Object
|
||||
public bridge final method size(): int
|
||||
|
||||
Vendored
+1
-1
@@ -66,7 +66,7 @@ public final class InlineMap {
|
||||
public static method isEmpty-impl(p0: java.util.Map): boolean
|
||||
public synthetic bridge method keySet(): java.util.Set
|
||||
public synthetic bridge method put(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
|
||||
public method put-eSoqwEg(p0: int, p1: double): IV
|
||||
public method put-t80dRTo(p0: int, p1: double): IV
|
||||
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
|
||||
|
||||
+4
-4
@@ -21,10 +21,10 @@ public final class InlineMutableList {
|
||||
private synthetic method <init>(p0: java.util.List): void
|
||||
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--AyYFnU(p0: int, p1: long): void
|
||||
public static method add--AyYFnU(p0: java.util.List, p1: int, p2: long): void
|
||||
public static method add-jHY5zpA(p0: java.util.List, p1: long): boolean
|
||||
public method add-jHY5zpA(p0: long): boolean
|
||||
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
|
||||
@@ -74,8 +74,8 @@ public final class InlineMutableList {
|
||||
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-_wdf3hM(p0: int, p1: long): long
|
||||
public static method set-_wdf3hM(p0: java.util.List, p1: int, p2: long): long
|
||||
public method set-kAA0daY(p0: int, p1: long): long
|
||||
public static method set-kAA0daY(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
|
||||
|
||||
+4
-4
@@ -21,10 +21,10 @@ public final class InlineMutableList {
|
||||
private synthetic method <init>(p0: java.util.List): void
|
||||
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--AyYFnU(p0: int, p1: long): void
|
||||
public static method add--AyYFnU(p0: java.util.List, p1: int, p2: long): void
|
||||
public static method add-jHY5zpA(p0: java.util.List, p1: long): boolean
|
||||
public method add-jHY5zpA(p0: long): boolean
|
||||
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
|
||||
@@ -74,8 +74,8 @@ public final class InlineMutableList {
|
||||
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-_wdf3hM(p0: int, p1: long): long
|
||||
public static method set-_wdf3hM(p0: java.util.List, p1: int, p2: long): long
|
||||
public method set-kAA0daY(p0: int, p1: long): long
|
||||
public static method set-kAA0daY(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
|
||||
|
||||
compiler/testData/codegen/bytecodeListing/inlineClasses/inlineCollectionOfInlineClass/mutableMap.txt
Vendored
+2
-2
@@ -67,8 +67,8 @@ public final class InlineMutableMap {
|
||||
public static method isEmpty-impl(p0: java.util.Map): boolean
|
||||
public bridge final method keySet(): java.util.Set
|
||||
public synthetic bridge method put(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
|
||||
public method put-eSoqwEg(p0: int, p1: double): IV
|
||||
public static method put-eSoqwEg(p0: java.util.Map, p1: int, p2: double): IV
|
||||
public method put-t80dRTo(p0: int, p1: double): IV
|
||||
public static method put-t80dRTo(p0: java.util.Map, p1: int, p2: double): IV
|
||||
public method putAll(p0: java.util.Map): void
|
||||
public static method putAll-impl(p0: java.util.Map, p1: java.util.Map): void
|
||||
public bridge final method remove(p0: java.lang.Object): java.lang.Object
|
||||
|
||||
+2
-2
@@ -67,8 +67,8 @@ public final class InlineMutableMap {
|
||||
public static method isEmpty-impl(p0: java.util.Map): boolean
|
||||
public synthetic bridge method keySet(): java.util.Set
|
||||
public synthetic bridge method put(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
|
||||
public method put-eSoqwEg(p0: int, p1: double): IV
|
||||
public static method put-eSoqwEg(p0: java.util.Map, p1: int, p2: double): IV
|
||||
public method put-t80dRTo(p0: int, p1: double): IV
|
||||
public static method put-t80dRTo(p0: java.util.Map, p1: int, p2: double): IV
|
||||
public method putAll(p0: java.util.Map): void
|
||||
public static method putAll-impl(p0: java.util.Map, p1: java.util.Map): void
|
||||
public bridge final method remove(p0: java.lang.Object): IV
|
||||
|
||||
+2
-2
@@ -19,6 +19,6 @@ public final class IC {
|
||||
@kotlin.Metadata
|
||||
public final class NullableAndNotNullPrimitiveKt {
|
||||
// source: 'nullableAndNotNullPrimitive.kt'
|
||||
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
|
||||
public final static method foo--SqozA0(@org.jetbrains.annotations.Nullable p0: java.lang.Integer, p1: int): void
|
||||
public final static method foo--SqozA0(p0: int, p1: int): void
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,5 +19,5 @@ public final class test/IC {
|
||||
@kotlin.Metadata
|
||||
public final class test/NewKt {
|
||||
// source: 'new.kt'
|
||||
public final static method foo-WsYm_fY(p0: int, p1: int): void
|
||||
public final static method foo-i2nDo8k(p0: int, p1: int): void
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,6 +18,6 @@ class B : A {
|
||||
override val i by Delegate()
|
||||
}
|
||||
|
||||
// 1 public final getValue-BwmXtik\(Ljava/lang/Object;Lkotlin/reflect/KProperty;\)I
|
||||
// 1 public final getValue-MJRKSbM\(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-RDSKdTE \(ILjava/lang/Object;Ljava/lang/Object;\)I
|
||||
// 1 INVOKESTATIC DelegateFactory\.provideDelegate-fSJJ7ck \(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-_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;
|
||||
// 1 public final static foo-O6Ntpp4\(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
|
||||
// 1 public static synthetic foo-O6Ntpp4\$default\(ILkotlin/coroutines/Continuation;ILjava/lang/Object;\)Ljava/lang/Object;
|
||||
// 1 INVOKESTATIC a/TestKt.foo-O6Ntpp4 \(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
|
||||
// 1 public final static bar-O6Ntpp4\(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-TwaN_yk
|
||||
// method: SomeClass$Companion::comp-hRy0JnA
|
||||
// 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-ZcpZUGQ
|
||||
// method: Test::asAll-rPNOez0
|
||||
// jvm signature: (ILjava/lang/Object;II)I
|
||||
// generic signature: null
|
||||
|
||||
Reference in New Issue
Block a user