Refactoring: use constants instead of string literals

This commit is contained in:
Nikolay Krasko
2017-02-24 16:47:04 +03:00
committed by Nikolay Krasko
parent fa5728b288
commit cd92e3fc98
3 changed files with 6 additions and 3 deletions

View File

@@ -4907,7 +4907,8 @@ The "returned" value of try expression with no finally is either the last expres
public NameGenerator getInlineNameGenerator() {
NameGenerator nameGenerator = getParentCodegen().getInlineNameGenerator();
Name name = context.getContextDescriptor().getName();
return nameGenerator.subGenerator((name.isSpecial() ? "$special" : name.asString()) + "$$inlined" );
String inlinedName = name.isSpecial() ? InlineCodegenUtil.SPECIAL_TRANSFORMATION_NAME : name.asString();
return nameGenerator.subGenerator(inlinedName + InlineCodegenUtil.INLINE_CALL_TRANSFORMATION_SUFFIX);
}
public Type getReturnType() {

View File

@@ -81,7 +81,9 @@ public class InlineCodegenUtil {
private static final String INLINE_MARKER_AFTER_METHOD_NAME = "afterInlineCall";
private static final String INLINE_MARKER_FINALLY_START = "finallyStart";
private static final String INLINE_MARKER_FINALLY_END = "finallyEnd";
public static final String SPECIAL_TRANSFORMATION_NAME = "$special";
public static final String INLINE_TRANSFORMATION_SUFFIX = "$inlined";
public static final String INLINE_CALL_TRANSFORMATION_SUFFIX = "$" + INLINE_TRANSFORMATION_SUFFIX;
public static final String INLINE_FUN_THIS_0_SUFFIX = "$inline_fun";
public static final String INLINE_FUN_VAR_SUFFIX = "$iv";

View File

@@ -232,8 +232,8 @@ class DebuggerClassNameProvider(val myDebugProcess: DebugProcess, val scopes: Li
val mangledInternalClassName =
className +
(if (ownerDescriptor.name.isSpecial) "\$\$special\$" else "$") +
InlineCodegenUtil.INLINE_TRANSFORMATION_SUFFIX + "$" +
(if (ownerDescriptor.name.isSpecial) "$" + InlineCodegenUtil.SPECIAL_TRANSFORMATION_NAME else "") +
InlineCodegenUtil.INLINE_CALL_TRANSFORMATION_SUFFIX + "$" +
inlineFunctionName
return listOf("$mangledInternalClassName*")