mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8338937: Optimize the string concatenation of ClassDesc
Reviewed-by: liach
This commit is contained in:
parent
d4dfa0127f
commit
55312e1549
7 changed files with 53 additions and 18 deletions
|
@ -125,7 +125,7 @@ class InvokerBytecodeGenerator {
|
|||
name = makeDumpableClassName(name);
|
||||
}
|
||||
this.name = name;
|
||||
this.className = CLASS_PREFIX + name;
|
||||
this.className = CLASS_PREFIX.concat(name);
|
||||
this.classDesc = ClassDesc.ofInternalName(className);
|
||||
this.lambdaForm = lambdaForm;
|
||||
this.invokerName = invokerName;
|
||||
|
@ -180,11 +180,16 @@ class InvokerBytecodeGenerator {
|
|||
if (ctr == null) ctr = 0;
|
||||
DUMP_CLASS_FILES_COUNTERS.put(className, ctr+1);
|
||||
}
|
||||
String sfx = ctr.toString();
|
||||
while (sfx.length() < 3)
|
||||
sfx = "0" + sfx;
|
||||
className += sfx;
|
||||
return className;
|
||||
|
||||
var buf = new StringBuilder(className.length() + 3).append(className);
|
||||
int ctrVal = ctr;
|
||||
if (ctrVal < 10) {
|
||||
buf.repeat('0', 2);
|
||||
} else if (ctrVal < 100) {
|
||||
buf.append('0');
|
||||
}
|
||||
buf.append(ctrVal);
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
static class ClassData {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue