Revert "JVM_IR indy-SAM: use '-Xsam-conversions=indy' if JVM 1.8+, LV 1.5+"
This reverts commit 679756ad
This commit is contained in:
@@ -213,13 +213,13 @@ class GenerationState private constructor(
|
||||
val fromConfig = configuration.get(JVMConfigurationKeys.SAM_CONVERSIONS)
|
||||
if (fromConfig != null && target >= fromConfig.minJvmTarget)
|
||||
fromConfig
|
||||
else if (
|
||||
target >= JvmClosureGenerationScheme.INDY.minJvmTarget &&
|
||||
languageVersionSettings.supportsFeature(LanguageFeature.SamWrapperClassesAreSynthetic)
|
||||
)
|
||||
JvmClosureGenerationScheme.INDY
|
||||
else
|
||||
else {
|
||||
// TODO wait for KT-44844 (properly support 'invokedynamic' in JPS incremental compilation)
|
||||
// Use JvmClosureGenerationScheme.INDY if
|
||||
// JVM target is at least JVM_1_8 &&
|
||||
// SamWrapperClassesAreSynthetic language feature is supported
|
||||
JvmClosureGenerationScheme.CLASS
|
||||
}
|
||||
}
|
||||
|
||||
val lambdasScheme = run {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// SAM_CONVERSIONS: CLASS
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// SAM_CONVERSIONS: CLASS
|
||||
// This optimization is only done by the JVM_IR backend.
|
||||
// IGNORE_BACKEND: JVM
|
||||
// FILE: JFoo.java
|
||||
@@ -18,6 +17,7 @@ fun test() {
|
||||
JFoo.foo(A()::f)
|
||||
}
|
||||
|
||||
// Referenced function called from run(), no wrapper class generated:
|
||||
// 1 NEW A
|
||||
// 2 NEW
|
||||
// 0 INVOKEINTERFACE
|
||||
|
||||
@@ -25,11 +25,5 @@ inline fun inlineFun() {
|
||||
// There should be no generic information in the SAM wrappers.
|
||||
// 0 declaration: void <init>\(kotlin.jvm.functions.Function1<.*, .*>\)
|
||||
// 0 declaration: function extends kotlin.jvm.functions.Function1<.*, .*>
|
||||
|
||||
// JVM_TEMPLATES
|
||||
// 2 private final synthetic Lkotlin/jvm/functions/Function1; function
|
||||
// 2 <init>\(Lkotlin/jvm/functions/Function1;\)V
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 1 private final synthetic Lkotlin/jvm/functions/Function1; function
|
||||
// 1 <init>\(Lkotlin/jvm/functions/Function1;\)V
|
||||
|
||||
+1
-3
@@ -1,6 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// ^ JVM_IR back-end generates SAM conversion with invokedynamic
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun box(): String {
|
||||
@@ -15,4 +13,4 @@ fun box(): String {
|
||||
throw Exception("!samJavaClass.isAnonymousClass(): '${samJavaClass.name}'")
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
LineBreakpoint created at samAdapter.kt:6
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
|
||||
@@ -103,7 +103,3 @@ org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.Scri
|
||||
org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.Script.testInnerClasses, KT-44472,,
|
||||
org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.testDelegatedNested, KT-44472,,
|
||||
org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.testDelegation, KT-44472,,
|
||||
org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.JavaUsedInKotlin.SamConversions.testMethodAdded, KT-44844 fixed in IDEA 212,,
|
||||
org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.JavaUsedInKotlin.SamConversions.testMethodAddedSamAdapter, KT-44844 fixed in IDEA 212,,
|
||||
org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.JavaUsedInKotlin.SamConversions.testMethodSignatureChanged, KT-44844 fixed in IDEA 212,,
|
||||
org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.JavaUsedInKotlin.SamConversions.testMethodSignatureChangedSamAdapter, KT-44844 fixed in IDEA 212,,
|
||||
|
||||
|
Reference in New Issue
Block a user