Mangle inline class members
<IMPL_SUFFIX> for method is a method signature hash, if method value parameter types contain inline class types, otherwise 'impl'. Constructor methods are named as 'constructor-<IMPL_SUFFIX>'. Synthesized 'box' and 'unbox' methods are named as '<METHOD_NAME>-<IMPL_SUFFIX>'. Erased implementations of overriding and non-overriding methods are named as '<METHOD_NAME>-<IMPL_SUFFIX>'. Fully specialized implementation of 'equals' will have a special suffix.
This commit is contained in:
Vendored
+3
-2
@@ -1,7 +1,8 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class AsNonNullPrimitive(val i: Int)
|
||||
inline class AsNonNullReference(val s: String) // 3 assertions (constructor, box method, static constructor in $Erased classs)
|
||||
inline class AsNonNullReference(val s: String)
|
||||
// ^ 5 assertions (constructor, box method, erased constructor, 2 assertions in equals--impl)
|
||||
|
||||
fun nonNullPrimitive(a: AsNonNullPrimitive) {}
|
||||
|
||||
@@ -11,4 +12,4 @@ fun AsNonNullReference.nonNullReferenceExtension(b1: AsNonNullReference) {} // 2
|
||||
fun asNullablePrimitive(c: AsNonNullPrimitive?) {}
|
||||
fun asNullableReference(c: AsNonNullReference?) {}
|
||||
|
||||
// 6 checkParameterIsNotNull
|
||||
// 8 checkParameterIsNotNull
|
||||
+1
-1
@@ -9,4 +9,4 @@ fun test(): Any = Z(42)
|
||||
// @TestKt.class:
|
||||
// 0 INVOKESTATIC Z\$Erased\.box
|
||||
// 0 INVOKESTATIC Z\-Erased\.box
|
||||
// 1 INVOKESTATIC Z\.box \(I\)LZ;
|
||||
// 1 INVOKESTATIC Z\.box-impl \(I\)LZ;
|
||||
+3
-3
@@ -12,7 +12,7 @@ inline class Foo(val x: Int) {
|
||||
}
|
||||
}
|
||||
|
||||
// 1 INVOKESTATIC Foo\.empty \(I\)V
|
||||
// 1 INVOKESTATIC Foo\.withParam \(ILjava/lang/String;\)V
|
||||
// 1 INVOKESTATIC Foo\.withInlineClassParam-1e4ch6lh \(II\)V
|
||||
// 1 INVOKESTATIC Foo\.empty-impl \(I\)V
|
||||
// 1 INVOKESTATIC Foo\.withParam-impl \(ILjava/lang/String;\)V
|
||||
// 1 INVOKESTATIC Foo\.withInlineClassParam-GWb7d6U \(II\)V
|
||||
// 5 INVOKEVIRTUAL
|
||||
+1
-1
@@ -11,4 +11,4 @@ fun testNZ(z: Z?) = z?.equals(z)
|
||||
// @TestKt.class:
|
||||
// 0 INVOKESTATIC Z\$Erased\.equals
|
||||
// 0 INVOKESTATIC Z\-Erased\.equals
|
||||
// 3 INVOKESTATIC Z\.equals \(ILjava/lang/Object;\)Z
|
||||
// 3 INVOKESTATIC Z\.equals-impl \(ILjava/lang/Object;\)Z
|
||||
+3
-3
@@ -15,6 +15,6 @@ fun test3() = Z(1, 2)
|
||||
// @TestKt.class:
|
||||
// 0 INVOKESTATIC Z\$Erased\.constructor
|
||||
// 0 INVOKESTATIC Z\-Erased\.constructor
|
||||
// 1 INVOKESTATIC Z\.constructor \(J\)I
|
||||
// 1 INVOKESTATIC Z\.constructor \(Ljava/lang/String;\)I
|
||||
// 1 INVOKESTATIC Z\.constructor \(II\)I
|
||||
// 1 INVOKESTATIC Z\.constructor-impl \(J\)I
|
||||
// 1 INVOKESTATIC Z\.constructor-impl \(Ljava/lang/String;\)I
|
||||
// 1 INVOKESTATIC Z\.constructor-impl \(II\)I
|
||||
+4
-4
@@ -23,7 +23,7 @@ fun test(password: Password) {
|
||||
if (password.password != "OK") throw AssertionError()
|
||||
}
|
||||
|
||||
// 1 public final static test-9zx0e0j9\(Ljava/lang/String;\)V
|
||||
// 1 public final static test-79jv2l6i\(Ljava/lang/String;\)V
|
||||
// 1 public final static test-d4pejdz3\(Ljava/lang/String;\)V
|
||||
// 1 public final static test-c6sgoxk6\(Ljava/lang/String;\)V
|
||||
// 1 public final static test-tmnojjU\(Ljava/lang/String;\)V
|
||||
// 1 public final static test-hI9h0ro\(Ljava/lang/String;\)V
|
||||
// 1 public final static test-75PUH38\(Ljava/lang/String;\)V
|
||||
// 1 public final static test-3mN7H-Y\(Ljava/lang/String;\)V
|
||||
+1
-1
@@ -10,4 +10,4 @@ fun testNZ(z: Z?) = z?.hashCode()
|
||||
// @TestKt.class:
|
||||
// 0 INVOKESTATIC Z\$Erased\.hashCode
|
||||
// 0 INVOKESTATIC Z\-Erased\.hashCode
|
||||
// 2 INVOKESTATIC Z\.hashCode \(I\)I
|
||||
// 2 INVOKESTATIC Z\.hashCode-impl \(I\)I
|
||||
|
||||
Vendored
+1
-1
@@ -9,4 +9,4 @@ fun testNZ(z: Z?) = z?.foo()
|
||||
|
||||
// 0 INVOKESTATIC Z\$Erased\.foo
|
||||
// 0 INVOKESTATIC Z\-Erased\.foo
|
||||
// 2 INVOKESTATIC Z\.foo \(I\)V
|
||||
// 2 INVOKESTATIC Z\.foo-impl \(I\)V
|
||||
|
||||
Vendored
+1
-1
@@ -17,4 +17,4 @@ fun testNZ(z: Z?) = z?.foo()
|
||||
// @TestKt.class:
|
||||
// 0 INVOKESTATIC Z\$Erased\.foo
|
||||
// 0 INVOKESTATIC Z\-Erased\.foo
|
||||
// 2 INVOKESTATIC Z\.foo \(I\)V
|
||||
// 2 INVOKESTATIC Z\.foo-impl \(I\)V
|
||||
Vendored
+1
-1
@@ -7,4 +7,4 @@ inline class Z(val x: Int)
|
||||
fun testZ() = Z(42)
|
||||
|
||||
// @TestKt.class:
|
||||
// 1 INVOKESTATIC Z\.constructor \(I\)I
|
||||
// 1 INVOKESTATIC Z\.constructor-impl \(I\)I
|
||||
|
||||
Vendored
+6
-6
@@ -33,9 +33,9 @@ fun Z.test() {
|
||||
// @TestKt.class:
|
||||
// 0 INVOKESTATIC Z\$Erased\.
|
||||
// 0 INVOKESTATIC Z\-Erased\.
|
||||
// 1 INVOKESTATIC Z.getAVal \(I\)I
|
||||
// 2 INVOKESTATIC Z.getAVar \(I\)I
|
||||
// 2 INVOKESTATIC Z.setAVar \(II\)V
|
||||
// 1 INVOKESTATIC Z.getExtVal \(ILjava/lang/String;\)I
|
||||
// 2 INVOKESTATIC Z.getExtVar \(ILjava/lang/String;\)I
|
||||
// 2 INVOKESTATIC Z.setExtVar \(ILjava/lang/String;I\)V
|
||||
// 1 INVOKESTATIC Z.getAVal-impl \(I\)I
|
||||
// 2 INVOKESTATIC Z.getAVar-impl \(I\)I
|
||||
// 2 INVOKESTATIC Z.setAVar-impl \(II\)V
|
||||
// 1 INVOKESTATIC Z.getExtVal-impl \(ILjava/lang/String;\)I
|
||||
// 2 INVOKESTATIC Z.getExtVar-impl \(ILjava/lang/String;\)I
|
||||
// 2 INVOKESTATIC Z.setExtVar-impl \(ILjava/lang/String;I\)V
|
||||
Vendored
+1
-1
@@ -7,4 +7,4 @@ class C {
|
||||
}
|
||||
|
||||
// 1 public final getS\(\)Ljava/lang/String;
|
||||
// 1 public final setS-90215lrx\(Ljava/lang/String;\)V
|
||||
// 1 public final setS-pD0jJn0\(Ljava/lang/String;\)V
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
inline class Z1(val x: Int)
|
||||
inline class Z2(val x: Z1)
|
||||
|
||||
fun test(zs: MutableList<Z2>, z: Z2) {
|
||||
zs.add(z)
|
||||
}
|
||||
|
||||
// 1 public final static synthetic box\(I\)LZ2;
|
||||
// 1 INVOKESTATIC Z2\.box \(I\)LZ2;
|
||||
+1
-1
@@ -10,4 +10,4 @@ fun testNZ(z: Z?) = z?.toString()
|
||||
// @TestKt.class:
|
||||
// 0 INVOKESTATIC Z\$Erased\.toString
|
||||
// 0 INVOKESTATIC Z\-Erased\.toString
|
||||
// 2 INVOKESTATIC Z\.toString \(I\)Ljava/lang/String;
|
||||
// 2 INVOKESTATIC Z\.toString-impl \(I\)Ljava/lang/String;
|
||||
|
||||
+1
-1
@@ -9,4 +9,4 @@ fun test(xs: List<Z>) = xs[0]
|
||||
// @TestKt.class:
|
||||
// 0 INVOKEVIRTUAL Z\$Erased\.unbox
|
||||
// 0 INVOKEVIRTUAL Z\-Erased\.unbox
|
||||
// 1 INVOKEVIRTUAL Z\.unbox \(\)I
|
||||
// 1 INVOKEVIRTUAL Z\.unbox-impl \(\)I
|
||||
Reference in New Issue
Block a user