8198888: Reduce string allocation churn in InvokerBytecodeGenerator

Reviewed-by: psandoz, plevart
This commit is contained in:
Claes Redestad 2018-03-01 13:08:06 +01:00
parent 5a7aff9897
commit ec495ebede
2 changed files with 18 additions and 2 deletions

View file

@ -107,6 +107,11 @@ public class BytecodeDescriptor {
}
public static String unparse(Class<?> type) {
if (type == Object.class) {
return "Ljava/lang/Object;";
} else if (type == int.class) {
return "I";
}
StringBuilder sb = new StringBuilder();
unparseSig(type, sb);
return sb.toString();
@ -148,6 +153,8 @@ public class BytecodeDescriptor {
char c = Wrapper.forBasicType(t).basicTypeChar();
if (c != 'L') {
sb.append(c);
} else if (t == Object.class) {
sb.append("Ljava/lang/Object;");
} else {
boolean lsemi = (!t.isArray());
if (lsemi) sb.append('L');