Change mangling for destructured lambda parameters
This commit is contained in:
Generated
+1
@@ -3,6 +3,7 @@
|
|||||||
<words>
|
<words>
|
||||||
<w>debuggee</w>
|
<w>debuggee</w>
|
||||||
<w>deserializes</w>
|
<w>deserializes</w>
|
||||||
|
<w>destructured</w>
|
||||||
<w>hacky</w>
|
<w>hacky</w>
|
||||||
<w>impls</w>
|
<w>impls</w>
|
||||||
<w>kapt</w>
|
<w>kapt</w>
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ import org.jetbrains.kotlin.resolve.checkers.ExpectedActualDeclarationChecker;
|
|||||||
import org.jetbrains.kotlin.resolve.deprecation.DeprecationResolver;
|
import org.jetbrains.kotlin.resolve.deprecation.DeprecationResolver;
|
||||||
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
|
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
|
||||||
import org.jetbrains.kotlin.resolve.jvm.*;
|
import org.jetbrains.kotlin.resolve.jvm.*;
|
||||||
import org.jetbrains.kotlin.resolve.jvm.checkers.DalvikIdentifierUtils;
|
|
||||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
|
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
|
||||||
import org.jetbrains.kotlin.serialization.DescriptorSerializer;
|
import org.jetbrains.kotlin.serialization.DescriptorSerializer;
|
||||||
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor;
|
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor;
|
||||||
@@ -205,26 +204,7 @@ public class AsmUtil {
|
|||||||
return defaultName;
|
return defaultName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DalvikIdentifierUtils.isValidDalvikIdentifier(callableName)) {
|
return prefix + VariableAsmNameManglingUtils.mangleNameIfNeeded(callableName);
|
||||||
return prefix + mangleLabel(callableName);
|
|
||||||
}
|
|
||||||
|
|
||||||
return prefix + callableName;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String mangleLabel(String label) {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
|
|
||||||
for (char c : label.toCharArray()) {
|
|
||||||
if (DalvikIdentifierUtils.isValidDalvikCharacter(c)) {
|
|
||||||
sb.append(c);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.append("_u").append(Integer.toHexString(c));
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -843,7 +843,7 @@ public class FunctionCodegen {
|
|||||||
|
|
||||||
if (kind == JvmMethodParameterKind.VALUE) {
|
if (kind == JvmMethodParameterKind.VALUE) {
|
||||||
ValueParameterDescriptor parameter = valueParameterIterator.next();
|
ValueParameterDescriptor parameter = valueParameterIterator.next();
|
||||||
String nameForDestructuredParameter = ValueParameterDescriptorImpl.getNameForDestructuredParameterOrNull(parameter);
|
String nameForDestructuredParameter = VariableAsmNameManglingUtils.getNameForDestructuredParameterOrNull(parameter);
|
||||||
|
|
||||||
parameterName =
|
parameterName =
|
||||||
nameForDestructuredParameter == null
|
nameForDestructuredParameter == null
|
||||||
@@ -902,7 +902,7 @@ public class FunctionCodegen {
|
|||||||
List<ValueParameterDescriptor> destructuredParametersForSuspendLambda
|
List<ValueParameterDescriptor> destructuredParametersForSuspendLambda
|
||||||
) {
|
) {
|
||||||
for (ValueParameterDescriptor parameter : destructuredParametersForSuspendLambda) {
|
for (ValueParameterDescriptor parameter : destructuredParametersForSuspendLambda) {
|
||||||
String nameForDestructuredParameter = ValueParameterDescriptorImpl.getNameForDestructuredParameterOrNull(parameter);
|
String nameForDestructuredParameter = VariableAsmNameManglingUtils.getNameForDestructuredParameterOrNull(parameter);
|
||||||
if (nameForDestructuredParameter == null) continue;
|
if (nameForDestructuredParameter == null) continue;
|
||||||
|
|
||||||
Type type = typeMapper.mapType(parameter.getType());
|
Type type = typeMapper.mapType(parameter.getType());
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@file:JvmName("VariableAsmNameManglingUtils")
|
||||||
|
package org.jetbrains.kotlin.codegen
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
||||||
|
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
|
||||||
|
import org.jetbrains.kotlin.resolve.jvm.checkers.isValidDalvikCharacter
|
||||||
|
|
||||||
|
fun getNameForDestructuredParameterOrNull(valueParameterDescriptor: ValueParameterDescriptor): String? {
|
||||||
|
val variables = ValueParameterDescriptorImpl.getDestructuringVariablesOrNull(valueParameterDescriptor) ?: return null
|
||||||
|
|
||||||
|
@Suppress("SpellCheckingInspection")
|
||||||
|
return "\$dstr\$" + variables.joinToString(separator = "$") { descriptor ->
|
||||||
|
val name = descriptor.name
|
||||||
|
mangleNameIfNeeded(
|
||||||
|
when {
|
||||||
|
name.isSpecial -> "\$_\$"
|
||||||
|
else -> descriptor.name.asString()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun mangleNameIfNeeded(name: String): String {
|
||||||
|
if (name.all { it.isValidCharacter() }) {
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|
||||||
|
return buildString {
|
||||||
|
for (c in name) {
|
||||||
|
if (c.isValidCharacter()) {
|
||||||
|
append(c)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
append("_u").append(Integer.toHexString(c.toInt()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Char.isValidCharacter(): Boolean {
|
||||||
|
return this != '$' && this != '-' && isValidDalvikCharacter(this)
|
||||||
|
}
|
||||||
+6
-2
@@ -183,8 +183,12 @@ class ExpressionCodegen(
|
|||||||
|
|
||||||
private fun writeValueParameterInLocalVariableTable(param: IrValueParameter, startLabel: Label) {
|
private fun writeValueParameterInLocalVariableTable(param: IrValueParameter, startLabel: Label) {
|
||||||
val descriptor = param.descriptor
|
val descriptor = param.descriptor
|
||||||
val nameForDestructuredParameter = if (descriptor is ValueParameterDescriptor)
|
val nameForDestructuredParameter = if (descriptor is ValueParameterDescriptor) {
|
||||||
ValueParameterDescriptorImpl.getNameForDestructuredParameterOrNull(descriptor) else null
|
getNameForDestructuredParameterOrNull(descriptor)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
val type = typeMapper.mapType(descriptor)
|
val type = typeMapper.mapType(descriptor)
|
||||||
// NOTE: we expect all value parameters to be present in the frame.
|
// NOTE: we expect all value parameters to be present in the frame.
|
||||||
mv.visitLocalVariable(
|
mv.visitLocalVariable(
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ fun box() {
|
|||||||
|
|
||||||
// METHOD : DestructuringInLambdasKt$box$1.invoke(LA;)Ljava/lang/String;
|
// METHOD : DestructuringInLambdasKt$box$1.invoke(LA;)Ljava/lang/String;
|
||||||
// VARIABLE : NAME=this TYPE=LDestructuringInLambdasKt$box$1; INDEX=0
|
// VARIABLE : NAME=this TYPE=LDestructuringInLambdasKt$box$1; INDEX=0
|
||||||
// VARIABLE : NAME=$x_y TYPE=LA; INDEX=1
|
// VARIABLE : NAME=$dstr$x$y TYPE=LA; INDEX=1
|
||||||
// VARIABLE : NAME=x TYPE=Ljava/lang/String; INDEX=2
|
// VARIABLE : NAME=x TYPE=Ljava/lang/String; INDEX=2
|
||||||
// VARIABLE : NAME=y TYPE=I INDEX=3
|
// VARIABLE : NAME=y TYPE=I INDEX=3
|
||||||
|
|||||||
+1
-1
@@ -15,6 +15,6 @@ suspend fun foo(data: Data, body: suspend (Data) -> Unit) {
|
|||||||
// METHOD : DataClassKt$test$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
// METHOD : DataClassKt$test$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
// VARIABLE : NAME=this TYPE=LDataClassKt$test$2; INDEX=0
|
// VARIABLE : NAME=this TYPE=LDataClassKt$test$2; INDEX=0
|
||||||
// VARIABLE : NAME=result TYPE=Ljava/lang/Object; INDEX=1
|
// VARIABLE : NAME=result TYPE=Ljava/lang/Object; INDEX=1
|
||||||
// VARIABLE : NAME=$x_param_y_param TYPE=LData; INDEX=2
|
// VARIABLE : NAME=$dstr$x_param$y_param TYPE=LData; INDEX=2
|
||||||
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
|
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
|
||||||
// VARIABLE : NAME=y_param TYPE=I INDEX=4
|
// VARIABLE : NAME=y_param TYPE=I INDEX=4
|
||||||
|
|||||||
Vendored
+1
-1
@@ -21,7 +21,7 @@ suspend fun test() = B.bar()
|
|||||||
// METHOD : ExtensionComponentsKt$bar$3.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
// METHOD : ExtensionComponentsKt$bar$3.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
// VARIABLE : NAME=this TYPE=LExtensionComponentsKt$bar$3; INDEX=0
|
// VARIABLE : NAME=this TYPE=LExtensionComponentsKt$bar$3; INDEX=0
|
||||||
// VARIABLE : NAME=result TYPE=Ljava/lang/Object; INDEX=1
|
// VARIABLE : NAME=result TYPE=Ljava/lang/Object; INDEX=1
|
||||||
// VARIABLE : NAME=$x_param_y_param_z_param TYPE=LA; INDEX=2
|
// VARIABLE : NAME=$dstr$x_param$y_param$z_param TYPE=LA; INDEX=2
|
||||||
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
|
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
|
||||||
// VARIABLE : NAME=y_param TYPE=Ljava/lang/String; INDEX=4
|
// VARIABLE : NAME=y_param TYPE=Ljava/lang/String; INDEX=4
|
||||||
// VARIABLE : NAME=z_param TYPE=I INDEX=5
|
// VARIABLE : NAME=z_param TYPE=I INDEX=5
|
||||||
|
|||||||
+1
-1
@@ -10,6 +10,6 @@ suspend fun test() = foo(A("OK", 1)) { (x_param, y_param) -> x_param + (y_param.
|
|||||||
// METHOD : GenericKt$test$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
// METHOD : GenericKt$test$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
// VARIABLE : NAME=this TYPE=LGenericKt$test$2; INDEX=0
|
// VARIABLE : NAME=this TYPE=LGenericKt$test$2; INDEX=0
|
||||||
// VARIABLE : NAME=result TYPE=Ljava/lang/Object; INDEX=1
|
// VARIABLE : NAME=result TYPE=Ljava/lang/Object; INDEX=1
|
||||||
// VARIABLE : NAME=$x_param_y_param TYPE=LA; INDEX=2
|
// VARIABLE : NAME=$dstr$x_param$y_param TYPE=LA; INDEX=2
|
||||||
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
|
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
|
||||||
// VARIABLE : NAME=y_param TYPE=I INDEX=4
|
// VARIABLE : NAME=y_param TYPE=I INDEX=4
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ suspend fun test() = foo(A("O", "K")) { (x_param, y_param) -> x_param + y_param
|
|||||||
// METHOD : InlineKt.test(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
// METHOD : InlineKt.test(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
// VARIABLE : NAME=<name for destructuring parameter 0> TYPE=LA; INDEX=4
|
// VARIABLE : NAME=<name for destructuring parameter 0> TYPE=LA; INDEX=4
|
||||||
// VARIABLE : NAME=continuation TYPE=Lkotlin/coroutines/Continuation; INDEX=3
|
// VARIABLE : NAME=continuation TYPE=Lkotlin/coroutines/Continuation; INDEX=3
|
||||||
// VARIABLE : NAME=$x_param_y_param TYPE=LA; INDEX=6
|
// VARIABLE : NAME=$dstr$x_param$y_param TYPE=LA; INDEX=6
|
||||||
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=7
|
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=7
|
||||||
// VARIABLE : NAME=y_param TYPE=Ljava/lang/String; INDEX=8
|
// VARIABLE : NAME=y_param TYPE=Ljava/lang/String; INDEX=8
|
||||||
// VARIABLE : NAME=$i$a$-foo-InlineKt$test$2 TYPE=I INDEX=5
|
// VARIABLE : NAME=$i$a$-foo-InlineKt$test$2 TYPE=I INDEX=5
|
||||||
|
|||||||
+1
-1
@@ -13,6 +13,6 @@ suspend fun test() = foo(A()) { (x_param, _, y_param) -> x_param + y_param }
|
|||||||
// METHOD : UnderscoreNamesKt$test$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
// METHOD : UnderscoreNamesKt$test$2.invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
// VARIABLE : NAME=this TYPE=LUnderscoreNamesKt$test$2; INDEX=0
|
// VARIABLE : NAME=this TYPE=LUnderscoreNamesKt$test$2; INDEX=0
|
||||||
// VARIABLE : NAME=result TYPE=Ljava/lang/Object; INDEX=1
|
// VARIABLE : NAME=result TYPE=Ljava/lang/Object; INDEX=1
|
||||||
// VARIABLE : NAME=$x_param_$_$_y_param TYPE=LA; INDEX=2
|
// VARIABLE : NAME=$dstr$x_param$-0024_-0024$y_param TYPE=LA; INDEX=2
|
||||||
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
|
// VARIABLE : NAME=x_param TYPE=Ljava/lang/String; INDEX=3
|
||||||
// VARIABLE : NAME=y_param TYPE=Ljava/lang/String; INDEX=4
|
// VARIABLE : NAME=y_param TYPE=Ljava/lang/String; INDEX=4
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ fun box(): String {
|
|||||||
|
|
||||||
// METHOD : DestructuringInlineLambdaKt.box()Ljava/lang/String;
|
// METHOD : DestructuringInlineLambdaKt.box()Ljava/lang/String;
|
||||||
// VARIABLE : NAME=i TYPE=I INDEX=2
|
// VARIABLE : NAME=i TYPE=I INDEX=2
|
||||||
// VARIABLE : NAME=$a1_a2_a3 TYPE=LStation; INDEX=1
|
// VARIABLE : NAME=$dstr$a1$a2$a3 TYPE=LStation; INDEX=1
|
||||||
// VARIABLE : NAME=a1 TYPE=Ljava/lang/String; INDEX=4
|
// VARIABLE : NAME=a1 TYPE=Ljava/lang/String; INDEX=4
|
||||||
// VARIABLE : NAME=a2 TYPE=Ljava/lang/String; INDEX=5
|
// VARIABLE : NAME=a2 TYPE=Ljava/lang/String; INDEX=5
|
||||||
// VARIABLE : NAME=a3 TYPE=I INDEX=6
|
// VARIABLE : NAME=a3 TYPE=I INDEX=6
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ fun box() {
|
|||||||
// VARIABLE : NAME=c TYPE=C INDEX=9
|
// VARIABLE : NAME=c TYPE=C INDEX=9
|
||||||
// VARIABLE : NAME=a TYPE=D INDEX=7
|
// VARIABLE : NAME=a TYPE=D INDEX=7
|
||||||
// VARIABLE : NAME=this TYPE=LUnderscoreNamesKt$box$1; INDEX=0
|
// VARIABLE : NAME=this TYPE=LUnderscoreNamesKt$box$1; INDEX=0
|
||||||
// VARIABLE : NAME=$x_$_$_y TYPE=LA; INDEX=1
|
// VARIABLE : NAME=$dstr$x$-0024_-0024$y TYPE=LA; INDEX=1
|
||||||
// VARIABLE : NAME=$noName_1 TYPE=Ljava/lang/String; INDEX=2
|
// VARIABLE : NAME=$noName_1 TYPE=Ljava/lang/String; INDEX=2
|
||||||
// VARIABLE : NAME=w TYPE=I INDEX=3
|
// VARIABLE : NAME=w TYPE=I INDEX=3
|
||||||
// VARIABLE : NAME=x TYPE=D INDEX=4
|
// VARIABLE : NAME=x TYPE=D INDEX=4
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// LOCAL_VARIABLE_TABLE
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
t { (`a b`, `b$c`, `c-d`, `b$$c--d`, `a()§&*&^@あ化`) -> }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun t(block: (Arr) -> Unit) {
|
||||||
|
block(Arr())
|
||||||
|
}
|
||||||
|
|
||||||
|
private data class Arr(
|
||||||
|
val a1: Int = 0,
|
||||||
|
val a2: Int = 0,
|
||||||
|
val a3: Int = 0,
|
||||||
|
val a4: Int = 0,
|
||||||
|
val a5: Int = 0
|
||||||
|
)
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
final class Arr : java/lang/Object {
|
||||||
|
private final int a1
|
||||||
|
|
||||||
|
private final int a2
|
||||||
|
|
||||||
|
private final int a3
|
||||||
|
|
||||||
|
private final int a4
|
||||||
|
|
||||||
|
private final int a5
|
||||||
|
|
||||||
|
public void <init>(int a1, int a2, int a3, int a4, int a5) {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
1 a1: I
|
||||||
|
2 a2: I
|
||||||
|
3 a3: I
|
||||||
|
4 a4: I
|
||||||
|
5 a5: I
|
||||||
|
}
|
||||||
|
|
||||||
|
public void <init>(int p0, int p1, int p2, int p3, int p4, int p5, kotlin.jvm.internal.DefaultConstructorMarker p6)
|
||||||
|
|
||||||
|
public void <init>()
|
||||||
|
|
||||||
|
public final int component1() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int component2() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int component3() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int component4() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int component5() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final Arr copy(int a1, int a2, int a3, int a4, int a5) {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
1 a1: I
|
||||||
|
2 a2: I
|
||||||
|
3 a3: I
|
||||||
|
4 a4: I
|
||||||
|
5 a5: I
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Arr copy$default(Arr p0, int p1, int p2, int p3, int p4, int p5, int p6, java.lang.Object p7)
|
||||||
|
|
||||||
|
public boolean equals(java.lang.Object p0)
|
||||||
|
|
||||||
|
public final int getA1() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getA2() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getA3() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getA4() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getA5() {
|
||||||
|
Local variables:
|
||||||
|
0 this: LArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int hashCode()
|
||||||
|
|
||||||
|
public java.lang.String toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
final class MangledNamesKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 {
|
||||||
|
public final static MangledNamesKt$foo$1 INSTANCE
|
||||||
|
|
||||||
|
static void <clinit>()
|
||||||
|
|
||||||
|
void <init>()
|
||||||
|
|
||||||
|
public java.lang.Object invoke(java.lang.Object p0)
|
||||||
|
|
||||||
|
public final void invoke(Arr $dstr$a_u20b$b_u24c$c_u2dd$b_u24_u24c_u2d_u2dd$a_u28_u29§_u26_u2a_u26_u5e_u40あ化) {
|
||||||
|
Local variables:
|
||||||
|
0 this: LMangledNamesKt$foo$1;
|
||||||
|
1 $dstr$a_u20b$b_u24c$c_u2dd$b_u24_u24c_u2d_u2dd$a_u28_u29§_u26_u2a_u26_u5e_u40あ化: LArr;
|
||||||
|
2 a b: I
|
||||||
|
3 b$c: I
|
||||||
|
4 c-d: I
|
||||||
|
5 b$$c--d: I
|
||||||
|
6 a()§&*&^@あ化: I
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class MangledNamesKt : java/lang/Object {
|
||||||
|
public final static void foo()
|
||||||
|
|
||||||
|
private final static void t(kotlin.jvm.functions.Function1 block) {
|
||||||
|
Local variables:
|
||||||
|
0 block: Lkotlin/jvm/functions/Function1;
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -86,6 +86,11 @@ public class AsmLikeInstructionListingTestGenerated extends AbstractAsmLikeInstr
|
|||||||
runTest("compiler/testData/codegen/asmLike/receiverMangling/innerClass.kt");
|
runTest("compiler/testData/codegen/asmLike/receiverMangling/innerClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("mangledNames.kt")
|
||||||
|
public void testMangledNames() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("nonInlineReceivers_after.kt")
|
@TestMetadata("nonInlineReceivers_after.kt")
|
||||||
public void testNonInlineReceivers_after() throws Exception {
|
public void testNonInlineReceivers_after() throws Exception {
|
||||||
runTest("compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt");
|
runTest("compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt");
|
||||||
|
|||||||
-10
@@ -61,16 +61,6 @@ open class ValueParameterDescriptorImpl(
|
|||||||
WithDestructuringDeclaration(containingDeclaration, original, index, annotations, name, outType,
|
WithDestructuringDeclaration(containingDeclaration, original, index, annotations, name, outType,
|
||||||
declaresDefaultValue, isCrossinline, isNoinline, varargElementType, source,
|
declaresDefaultValue, isCrossinline, isNoinline, varargElementType, source,
|
||||||
destructuringVariables)
|
destructuringVariables)
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
fun getNameForDestructuredParameterOrNull(valueParameterDescriptor: ValueParameterDescriptor): String? {
|
|
||||||
val variablesOrNull = ValueParameterDescriptorImpl.getDestructuringVariablesOrNull(valueParameterDescriptor)
|
|
||||||
return if (variablesOrNull == null) null else
|
|
||||||
"$" + join(
|
|
||||||
variablesOrNull.map { descriptor -> if (descriptor.name.isSpecial) "\$_\$" else descriptor.name.asString() },
|
|
||||||
"_"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class WithDestructuringDeclaration internal constructor(
|
class WithDestructuringDeclaration internal constructor(
|
||||||
|
|||||||
Vendored
+1
-1
@@ -7,7 +7,7 @@ Compile bytecode for y
|
|||||||
frame = invoke:12, DestructuringParamKt$main$1 {destructuringParam}
|
frame = invoke:12, DestructuringParamKt$main$1 {destructuringParam}
|
||||||
this = this = {destructuringParam.DestructuringParamKt$main$1@uniqueID}Function1<destructuringParam.A, java.lang.String>
|
this = this = {destructuringParam.DestructuringParamKt$main$1@uniqueID}Function1<destructuringParam.A, java.lang.String>
|
||||||
field = arity: int = 1 (sp = Lambda.!EXT!)
|
field = arity: int = 1 (sp = Lambda.!EXT!)
|
||||||
local = $x_y: destructuringParam.A = {destructuringParam.A@uniqueID}A(x=O, y=K) (sp = null)
|
local = $dstr$x$y: destructuringParam.A = {destructuringParam.A@uniqueID}A(x=O, y=K) (sp = null)
|
||||||
field = x: java.lang.String = O (sp = destructuringParam.kt, 2)
|
field = x: java.lang.String = O (sp = destructuringParam.kt, 2)
|
||||||
field = value: char[] = {char[1]@uniqueID} (sp = String.!EXT!)
|
field = value: char[] = {char[1]@uniqueID} (sp = String.!EXT!)
|
||||||
element = 0 = 'O' 79
|
element = 0 = 'O' 79
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ Compile bytecode for arrayOfA
|
|||||||
frame = invoke:18, UnderscoreNamesKt$main$1 {underscoreNames}
|
frame = invoke:18, UnderscoreNamesKt$main$1 {underscoreNames}
|
||||||
this = this = {underscoreNames.UnderscoreNamesKt$main$1@uniqueID}Function3<underscoreNames.A, java.lang.String, java.lang.Integer, java.lang.String>
|
this = this = {underscoreNames.UnderscoreNamesKt$main$1@uniqueID}Function3<underscoreNames.A, java.lang.String, java.lang.Integer, java.lang.String>
|
||||||
field = arity: int = 3 (sp = Lambda.!EXT!)
|
field = arity: int = 3 (sp = Lambda.!EXT!)
|
||||||
local = $x_$_$_y: underscoreNames.A = {underscoreNames.A@uniqueID}A(x=1.0, y=, z=0) (sp = null)
|
local = $dstr$x$-0024_-0024$y: underscoreNames.A = {underscoreNames.A@uniqueID}A(x=1.0, y=, z=0) (sp = null)
|
||||||
field = x: double = 1.0 (sp = underscoreNames.kt, 2)
|
field = x: double = 1.0 (sp = underscoreNames.kt, 2)
|
||||||
field = y: java.lang.String = (sp = underscoreNames.kt, 2)
|
field = y: java.lang.String = (sp = underscoreNames.kt, 2)
|
||||||
field = value: char[] = {char[0]@uniqueID} (sp = String.!EXT!)
|
field = value: char[] = {char[0]@uniqueID} (sp = String.!EXT!)
|
||||||
|
|||||||
Reference in New Issue
Block a user