mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
[kotlin] Drop inline suffixes from spilled variables
^KTIJ-26894 Fixed closes https://github.com/JetBrains/intellij-community/pull/2567 GitOrigin-RevId: 124cdb7f9d3ef6bf1e769101f3afd836c9770b9f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eb0a692425
commit
78b1dcf907
@@ -5,6 +5,7 @@ package org.jetbrains.kotlin.idea.debugger.coroutine.proxy
|
||||
import com.intellij.debugger.engine.JavaValue
|
||||
import com.sun.jdi.ObjectReference
|
||||
import com.sun.jdi.VMDisconnectedException
|
||||
import org.jetbrains.kotlin.idea.debugger.base.util.dropInlineSuffix
|
||||
import org.jetbrains.kotlin.idea.debugger.coroutine.data.*
|
||||
import org.jetbrains.kotlin.idea.debugger.coroutine.proxy.mirror.*
|
||||
import org.jetbrains.kotlin.idea.debugger.coroutine.util.isAbstractCoroutine
|
||||
@@ -121,7 +122,7 @@ fun FieldVariable.toJavaValue(continuation: ObjectReference, context: DefaultExe
|
||||
context,
|
||||
continuation,
|
||||
fieldName,
|
||||
variableName
|
||||
dropInlineSuffix(variableName)
|
||||
)
|
||||
return JavaValue.create(
|
||||
null,
|
||||
|
||||
@@ -62,4 +62,9 @@ public class K2IdeK1CodeKotlinVariablePrintingTestGenerated extends AbstractK2Id
|
||||
public void testReentrantInlineFunctions() throws Exception {
|
||||
runTest("../testData/variables/reentrantInlineFunctions.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("spilledCapturedVariables.kt")
|
||||
public void testSpilledCapturedVariables() throws Exception {
|
||||
runTest("../testData/variables/spilledCapturedVariables.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,9 @@ public class K2IdeK2CodeKotlinVariablePrintingTestGenerated extends AbstractK2Id
|
||||
public void testReentrantInlineFunctions() throws Exception {
|
||||
runTest("../testData/variables/reentrantInlineFunctions.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("spilledCapturedVariables.kt")
|
||||
public void testSpilledCapturedVariables() throws Exception {
|
||||
runTest("../testData/variables/spilledCapturedVariables.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,9 @@ public class K1IdeK2CodeKotlinVariablePrintingTestGenerated extends AbstractK1Id
|
||||
public void testReentrantInlineFunctions() throws Exception {
|
||||
runTest("testData/variables/reentrantInlineFunctions.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("spilledCapturedVariables.kt")
|
||||
public void testSpilledCapturedVariables() throws Exception {
|
||||
runTest("testData/variables/spilledCapturedVariables.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,9 @@ public class KotlinVariablePrintingTestGenerated extends AbstractKotlinVariableP
|
||||
public void testReentrantInlineFunctions() throws Exception {
|
||||
runTest("testData/variables/reentrantInlineFunctions.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("spilledCapturedVariables.kt")
|
||||
public void testSpilledCapturedVariables() throws Exception {
|
||||
runTest("testData/variables/spilledCapturedVariables.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ CoroutinePreflightFrame invokeSuspend (optimisedVariablesInSuspendInline.kt:14)
|
||||
optimisedVariablesInSuspendInline.kt:17
|
||||
CoroutinePreflightFrame invokeSuspend (optimisedVariablesInSuspendInline.kt:17)
|
||||
JavaValue[local] a: java.lang.String = a (optimisedVariablesInSuspendInline.kt:9)
|
||||
JavaValue[continuation] a$iv = a
|
||||
DummyMessageValueNode = 'b' was optimised out
|
||||
optimisedVariablesInSuspendInline.kt:19
|
||||
CoroutinePreflightFrame invokeSuspend (optimisedVariablesInSuspendInline.kt:19)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package spilledCapturedVariables
|
||||
|
||||
// ATTACH_LIBRARY: maven(org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2)
|
||||
// SHOW_KOTLIN_VARIABLES
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
class A {
|
||||
suspend inline fun foo() {
|
||||
val x = 1
|
||||
inlineBlock {
|
||||
val y = 1
|
||||
inlineBlock {
|
||||
val z = 1
|
||||
//Breakpoint!
|
||||
suspendUse(z)
|
||||
}
|
||||
//Breakpoint!
|
||||
suspendUse(y)
|
||||
}
|
||||
//Breakpoint!
|
||||
suspendUse(x)
|
||||
}
|
||||
}
|
||||
|
||||
fun main() = runBlocking {
|
||||
A().foo()
|
||||
}
|
||||
|
||||
suspend fun suspendUse(value: Any) {
|
||||
}
|
||||
|
||||
inline fun inlineBlock(block: () -> Unit) = block()
|
||||
@@ -0,0 +1,23 @@
|
||||
LineBreakpoint created at spilledCapturedVariables.kt:16
|
||||
LineBreakpoint created at spilledCapturedVariables.kt:19
|
||||
LineBreakpoint created at spilledCapturedVariables.kt:22
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
spilledCapturedVariables.kt:16
|
||||
CoroutinePreflightFrame invokeSuspend (spilledCapturedVariables.kt:16)
|
||||
JavaValue[local] x: int = 1 (spilledCapturedVariables.kt:10)
|
||||
JavaValue[local] y: int = 1 (spilledCapturedVariables.kt:12)
|
||||
JavaValue[local] z: int = 1 (spilledCapturedVariables.kt:14)
|
||||
spilledCapturedVariables.kt:19
|
||||
CoroutinePreflightFrame invokeSuspend (spilledCapturedVariables.kt:19)
|
||||
JavaValue[local] y: int = 1 (spilledCapturedVariables.kt:12)
|
||||
JavaValue[local] x: int = 1 (spilledCapturedVariables.kt:10)
|
||||
DummyMessageValueNode = 'z' was optimised out
|
||||
spilledCapturedVariables.kt:22
|
||||
CoroutinePreflightFrame invokeSuspend (spilledCapturedVariables.kt:22)
|
||||
JavaValue[local] x: int = 1 (spilledCapturedVariables.kt:10)
|
||||
DummyMessageValueNode = 'y' was optimised out
|
||||
DummyMessageValueNode = 'z' was optimised out
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
Reference in New Issue
Block a user