IC mangling: Change mangling rules

1. Use 'x' for each parameter, which is not an inline class, every
possible clash is handled by signature rather than name. This change
makes more API changes binary-compatible. So, the changes are in line
with the vision of inline classes are value classes, like primitives.

2. Take return type into account when mangling a function if the return
type is inline class. Otherwise, boxing bridge will not be generated,
which leads to CCE at runtime.
This commit is contained in:
Ilmir Usmanov
2020-11-03 01:05:52 +01:00
parent d21a01ef59
commit c62093f54c
42 changed files with 250 additions and 83 deletions
@@ -18,6 +18,6 @@ class B : A {
override val i by Delegate()
}
// 1 public final getValue-lPtA-2M\(Ljava/lang/Object;Lkotlin/reflect/KProperty;\)I
// 1 public final getValue-Y6jMyTM\(Ljava/lang/Object;Lkotlin/reflect/KProperty;\)I
// 1 public getI-lPtA-2M\(\)I
// 1 public abstract getI-lPtA-2M\(\)I
@@ -28,6 +28,6 @@ inline class Delegate(val default: Int) {
// 0 DelegateFactory\.unbox
// 0 Delegate\.box
// 0 Delegate\.unbox
// 1 INVOKESTATIC DelegateFactory\.provideDelegate-ARVzKNs \(ILjava/lang/Object;Ljava/lang/Object;\)I
// 1 INVOKESTATIC DelegateFactory\.provideDelegate-gy51yk8 \(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
@@ -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-zMJ7EWY\(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
// 1 public static synthetic foo-zMJ7EWY\$default\(ILkotlin/coroutines/Continuation;ILjava/lang/Object;\)Ljava/lang/Object;
// 1 INVOKESTATIC a/TestKt.foo-zMJ7EWY \(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
// 1 public final static bar-zMJ7EWY\(ILkotlin/coroutines/Continuation;\)Ljava/lang/Object;
// 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;