Generate meaningful bytecode names for extension receivers in INDY lambdas
This commit is contained in:
committed by
teamcity
parent
2953e600ff
commit
4436ce22b0
+6
@@ -4267,6 +4267,12 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionReceiversNames.kt")
|
||||||
|
public void testExtensionReceiversNames() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeText/invokedynamic/extensionReceiversNames.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("functionRefToJavaInterface.kt")
|
@TestMetadata("functionRefToJavaInterface.kt")
|
||||||
public void testFunctionRefToJavaInterface() throws Exception {
|
public void testFunctionRefToJavaInterface() throws Exception {
|
||||||
|
|||||||
+1
-1
@@ -446,7 +446,7 @@ internal class LambdaMetafactoryArgumentsBuilder(
|
|||||||
var newParameterIndex = 0
|
var newParameterIndex = 0
|
||||||
|
|
||||||
newValueParameters.add(
|
newValueParameters.add(
|
||||||
oldExtensionReceiver.copy(lambda, newParameterIndex++, Name.identifier("\$receiver")).also {
|
oldExtensionReceiver.copy(lambda, newParameterIndex++, oldExtensionReceiver.name).also {
|
||||||
oldToNew[oldExtensionReceiver] = it
|
oldToNew[oldExtensionReceiver] = it
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
// LANGUAGE: +LightweightLambdas
|
||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
|
||||||
|
fun <T> block(t: T, f: T.() -> Unit) {
|
||||||
|
f.invoke(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
block("first") place1@ {
|
||||||
|
block("second") place2@ {
|
||||||
|
// Breakpoint here
|
||||||
|
this@place1
|
||||||
|
this@place2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// JVM_IR_TEMPLATES
|
||||||
|
// 2 INVOKEDYNAMIC
|
||||||
|
// 0 receiver
|
||||||
|
// 5 LOCALVARIABLE
|
||||||
|
// 1 LOCALVARIABLE \$this\$place1
|
||||||
|
// 1 LOCALVARIABLE \$this\$place2
|
||||||
|
// 1 LOCALVARIABLE t
|
||||||
|
// 1 LOCALVARIABLE f
|
||||||
|
// 1 LOCALVARIABLE \$this_place1
|
||||||
|
// 1 LDC "\$this\$place1"
|
||||||
|
// 1 LDC "\$this\$place2"
|
||||||
+6
@@ -4267,6 +4267,12 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionReceiversNames.kt")
|
||||||
|
public void testExtensionReceiversNames() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeText/invokedynamic/extensionReceiversNames.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("functionRefToJavaInterface.kt")
|
@TestMetadata("functionRefToJavaInterface.kt")
|
||||||
public void testFunctionRefToJavaInterface() throws Exception {
|
public void testFunctionRefToJavaInterface() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user