JVM: do not write trivial SMAPs to any classes

Even ones inside inline functions. This was a backwards compatibility
hack for Kotlin 1.4, where the inliner would crash if it attempted to
regenerate an anonymous object with no SMAP; that has been fixed in 1.5,
and ever since then trivial SMAPs could be inferred from line number
markers in methods.

There are three kinds of changes to tests in this commit:

  * Some SMAPs are gone entirely - self-explanatory.

  * Some SMAPs have narrower line ranges - that's because the old SMAP
    had the range for the entire file, while the new one only maps up to
    the last line number used in the class. There should be no
    difference in behavior.

  * Some "source file name" markers are removed in continuation objects
    - continuations don't have any line numbers, so there's no debugging
    information anyway. The actual source information is in the
    containing class.
This commit is contained in:
Sonya Valchuk
2024-03-11 09:00:41 +00:00
committed by Space Cloud
parent fc992274bb
commit e5ad035039
43 changed files with 104 additions and 406 deletions
@@ -81,7 +81,6 @@ public final class TcoContinuationKt$foo$$inlined$flow$1 {
@kotlin.Metadata
@kotlin.coroutines.jvm.internal.DebugMetadata
public final class TcoContinuationKt$foo$$inlined$map$1$2$1 {
// source: 'tcoContinuation.kt'
enclosing method TcoContinuationKt$foo$$inlined$map$1$2.emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
field L$0: java.lang.Object
field label: int
@@ -116,7 +115,6 @@ public final class TcoContinuationKt$foo$$inlined$map$1 {
@kotlin.Metadata
public final class TcoContinuationKt$map$$inlined$transform$1$1 {
// source: 'tcoContinuation.kt'
enclosing method TcoContinuationKt$map$$inlined$transform$1.collect(LFlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
field label: int
synthetic field result: java.lang.Object
@@ -130,7 +128,6 @@ public final class TcoContinuationKt$map$$inlined$transform$1$1 {
@kotlin.Metadata
@kotlin.coroutines.jvm.internal.DebugMetadata
public final class TcoContinuationKt$map$$inlined$transform$1$2$1 {
// source: 'tcoContinuation.kt'
enclosing method TcoContinuationKt$map$$inlined$transform$1$2.emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
field L$0: java.lang.Object
field label: int
@@ -170,7 +167,6 @@ public final class TcoContinuationKt$map$$inlined$transform$1 {
@kotlin.Metadata
public final class TcoContinuationKt$transform$$inlined$flow$1$1 {
// source: 'tcoContinuation.kt'
enclosing method TcoContinuationKt$transform$$inlined$flow$1.collect(LFlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
field label: int
synthetic field result: java.lang.Object
@@ -196,7 +192,6 @@ public final class TcoContinuationKt$transform$$inlined$flow$1 {
@kotlin.Metadata
public final class TcoContinuationKt$transform$lambda$1$$inlined$collect$1$1 {
// source: 'tcoContinuation.kt'
enclosing method TcoContinuationKt$transform$lambda$1$$inlined$collect$1.emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
field label: int
synthetic field result: java.lang.Object