mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8198888: Reduce string allocation churn in InvokerBytecodeGenerator
Reviewed-by: psandoz, plevart
This commit is contained in:
parent
5a7aff9897
commit
ec495ebede
2 changed files with 18 additions and 2 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue