RFR: 8311220: Optimization for StringLatin UpperLower

Chen Liang liach at openjdk.org
Mon Jul 3 07:32:57 UTC 2023


On Mon, 3 Jul 2023 05:29:57 GMT, 温绍锦 <duke at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/StringLatin1.java line 498:
>> 
>>> 496:         for (first = 0 ; first < len; first++ ) {
>>> 497:             int cp = value[first] & 0xff;
>>> 498:             if (cp >= 'a' && (cp <= 'z' || cp == 181 || (cp >= 223 && cp != 247))) {
>> 
>> The following would be consistent with your other changes:
>> 
>> if (CharacterDataLatin1.instance.isLowerCase(value[first] & 0xff)) {
>
> When the value of cp is 170 or 186, the result of using isLowerCase is not expected, and it also cause build fail.

Should we define a new method in `CharacterDataLain1` for such a dedicated check?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14751#discussion_r1250392626


More information about the core-libs-dev mailing list