KT-746 Fill LocalVariableTable with method parameter names
This commit is contained in:
@@ -78,6 +78,10 @@ public class FunctionCodegen {
|
|||||||
}
|
}
|
||||||
if (!isAbstract && v.generateCode()) {
|
if (!isAbstract && v.generateCode()) {
|
||||||
mv.visitCode();
|
mv.visitCode();
|
||||||
|
|
||||||
|
Label methodBegin = new Label();
|
||||||
|
mv.visitLabel(methodBegin);
|
||||||
|
|
||||||
FrameMap frameMap = context.prepareFrame();
|
FrameMap frameMap = context.prepareFrame();
|
||||||
|
|
||||||
ExpressionCodegen codegen = new ExpressionCodegen(mv, frameMap, jvmSignature.getReturnType(), context, state);
|
ExpressionCodegen codegen = new ExpressionCodegen(mv, frameMap, jvmSignature.getReturnType(), context, state);
|
||||||
@@ -126,6 +130,18 @@ public class FunctionCodegen {
|
|||||||
|
|
||||||
codegen.returnExpression(bodyExpressions);
|
codegen.returnExpression(bodyExpressions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label methodEnd = new Label();
|
||||||
|
mv.visitLabel(methodEnd);
|
||||||
|
|
||||||
|
// http://youtrack.jetbrains.net/issue/KT-746
|
||||||
|
// Fill LocalVariableTable with method parameter names
|
||||||
|
for (int i = 0; i < paramDescrs.size(); i++) {
|
||||||
|
ValueParameterDescriptor parameter = paramDescrs.get(i);
|
||||||
|
Type type = state.getTypeMapper().mapType(parameter.getOutType());
|
||||||
|
// TODO: specify signature
|
||||||
|
mv.visitLocalVariable(parameter.getName(), type.getDescriptor(), null, methodBegin, methodEnd, i + add);
|
||||||
|
}
|
||||||
|
|
||||||
mv.visitMaxs(0, 0);
|
mv.visitMaxs(0, 0);
|
||||||
mv.visitEnd();
|
mv.visitEnd();
|
||||||
|
|||||||
Reference in New Issue
Block a user