mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8339635: StringConcatFactory optimization for CompactStrings off
Reviewed-by: liach
This commit is contained in:
parent
8e580ec538
commit
fbe2629303
3 changed files with 15 additions and 1 deletions
|
@ -2642,6 +2642,10 @@ public final class System {
|
|||
return new StringConcatHelper.Concat1(constants);
|
||||
}
|
||||
|
||||
public byte stringInitCoder() {
|
||||
return String.COMPACT_STRINGS ? String.LATIN1 : String.UTF16;
|
||||
}
|
||||
|
||||
public int getCharsLatin1(long i, int index, byte[] buf) {
|
||||
return StringLatin1.getChars(i, index, buf);
|
||||
}
|
||||
|
|
|
@ -1196,9 +1196,14 @@ public final class StringConcatFactory {
|
|||
|
||||
/**
|
||||
* Construct the MethodType of the coder method. The first parameter is the initialized coder.
|
||||
* Only parameter types which can be UTF16 are added. Returns null if no such parameter exists.
|
||||
* Only parameter types which can be UTF16 are added.
|
||||
* Returns null if no such parameter exists or CompactStrings is off.
|
||||
*/
|
||||
private static MethodTypeDesc coderArgsIfMaybeUTF16(MethodType concatArgs) {
|
||||
if (JLA.stringInitCoder() != 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int parameterCount = concatArgs.parameterCount();
|
||||
|
||||
int maybeUTF16Count = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue