diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java index d5869e937f6..da861a3b006 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java @@ -100,6 +100,8 @@ public class AsmUtil { public static final String THIS = "this"; + public static final String THIS_IN_DEFAULT_IMPLS = "$this"; + public static final String LABELED_THIS_FIELD = THIS + "_"; public static final String LABELED_THIS_PARAMETER = "$" + THIS + "$"; diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/KotlinStackFrame.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/KotlinStackFrame.kt index 0ef056c1905..4d3b620a6d7 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/KotlinStackFrame.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/KotlinStackFrame.kt @@ -199,7 +199,7 @@ class KotlinStackFrame(frame: StackFrameProxyImpl) : JavaStackFrame(StackFrameDe .filter { !isHidden(it, inlineDepth) } .partition { it.name() == THIS - || it.name() == AsmUtil.getCapturedFieldName(AsmUtil.THIS) + || it.name() == AsmUtil.THIS_IN_DEFAULT_IMPLS || it.name().startsWith(AsmUtil.LABELED_THIS_PARAMETER) || (VariableFinder.inlinedThisRegex.matches(it.name())) } @@ -231,7 +231,7 @@ class KotlinStackFrame(frame: StackFrameProxyImpl) : JavaStackFrame(StackFrameDe val label = name.drop(AsmUtil.LABELED_THIS_PARAMETER.length) clone(getThisName(label), label) } - name == AsmUtil.getCapturedFieldName(AsmUtil.THIS) -> clone(THIS + " (outer)", null) + name == AsmUtil.THIS_IN_DEFAULT_IMPLS -> clone(THIS + " (outer)", null) name == AsmUtil.RECEIVER_PARAMETER_NAME -> clone(THIS + " (receiver)", null) VariableFinder.inlinedThisRegex.matches(name) -> { val label = generateThisLabel(frame.getValue(this)?.type()) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/variables/VariableFinder.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/variables/VariableFinder.kt index c4fb8898479..8ef9daedff8 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/variables/VariableFinder.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/variables/VariableFinder.kt @@ -265,7 +265,7 @@ class VariableFinder private constructor(private val context: ExecutionContext, if (isInsideDefaultImpls()) { val variables = frameProxy.safeVisibleVariables() - findLocalVariable(variables, kind, getCapturedFieldName(AsmUtil.THIS))?.let { return it } + findLocalVariable(variables, kind, AsmUtil.THIS_IN_DEFAULT_IMPLS)?.let { return it } } val variables = frameProxy.safeVisibleVariables() @@ -383,7 +383,7 @@ class VariableFinder private constructor(private val context: ExecutionContext, fun isReceiverOrPassedThis(name: String) = name.startsWith(AsmUtil.LABELED_THIS_PARAMETER) || name == AsmUtil.RECEIVER_PARAMETER_NAME - || name == getCapturedFieldName(AsmUtil.THIS) + || name == AsmUtil.THIS_IN_DEFAULT_IMPLS || inlinedThisRegex.matches(name) if (kind is VariableKind.ExtensionThis) { @@ -426,7 +426,7 @@ class VariableFinder private constructor(private val context: ExecutionContext, // Recursive search in outer and captured this fields.namedEntitySequence(parent) - .filter { it.name == getCapturedFieldName(AsmUtil.THIS) || it.name == AsmUtil.CAPTURED_THIS_FIELD } + .filter { it.name == AsmUtil.THIS_IN_DEFAULT_IMPLS || it.name == AsmUtil.CAPTURED_THIS_FIELD } .mapNotNull { findCapturedVariable(kind, it.value()) } .firstOrNull() ?.let { return it }