From 069ef8ef919cdeadfdfb06000247a6de3f105c50 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Mon, 1 Oct 2012 21:02:28 +0400 Subject: [PATCH] KT-2712 Debugger should show value of receiver of extension functions #KT-2712 fixed --- .../src/org/jetbrains/jet/codegen/FunctionCodegen.java | 4 ++-- .../src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java | 1 + runtime/src/jet/runtime/typeinfo/JetMethod.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java index 4d084db32e9..c9174eafc8e 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java @@ -245,7 +245,7 @@ public class FunctionCodegen extends GenerationStateAware { if (receiverParameter.exists()) { Type type = state.getTypeMapper().mapType(receiverParameter.getType()); // TODO: specify signature - mv.visitLocalVariable("this$receiver", type.getDescriptor(), null, methodBegin, methodEnd, k); + mv.visitLocalVariable(JvmAbi.RECEIVER_PARAMETER, type.getDescriptor(), null, methodBegin, methodEnd, k); k += type.getSize(); } @@ -370,7 +370,7 @@ public class FunctionCodegen extends GenerationStateAware { if (receiverParameter.exists()) { JetValueParameterAnnotationWriter av = JetValueParameterAnnotationWriter.visitParameterAnnotation(mv, start++); - av.writeName("this$receiver"); + av.writeName(JvmAbi.RECEIVER_PARAMETER); av.writeReceiver(); if (kotlinParameterTypes.get(0) != null) { av.writeType(kotlinParameterTypes.get(0).getKotlinSignature()); diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java index 1c6fbbd9aeb..4ce1647e1b9 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/JvmAbi.java @@ -32,6 +32,7 @@ public class JvmAbi { public static final String CLASS_OBJECT_SUFFIX = "$" + CLASS_OBJECT_CLASS_NAME; public static final String INSTANCE_FIELD = "$instance"; + public static final String RECEIVER_PARAMETER = "$receiver"; public static final JvmClassName JETBRAINS_NOT_NULL_ANNOTATION = JvmClassName.byFqNameWithoutInnerClasses("org.jetbrains.annotations.NotNull"); diff --git a/runtime/src/jet/runtime/typeinfo/JetMethod.java b/runtime/src/jet/runtime/typeinfo/JetMethod.java index 30236caa51b..4c8f5d3e870 100644 --- a/runtime/src/jet/runtime/typeinfo/JetMethod.java +++ b/runtime/src/jet/runtime/typeinfo/JetMethod.java @@ -24,7 +24,7 @@ import java.lang.annotation.Target; /** * Annotation for method * - * The fact of receiver presence must be deducted from presence of 'this$receiver' parameter + * The fact of receiver presence must be deducted from presence of '$receiver' parameter * * @author alex.tkachman *