RFR: 8357690: Add @Stable and final to java.lang.CharacterDataLatin1 and other CharacterData classes [v2]
Naoto Sato
naoto at openjdk.org
Tue May 27 16:52:55 UTC 2025
On Mon, 26 May 2025 13:19:08 GMT, Shaojin Wen <swen at openjdk.org> wrote:
>> Classes such as java.lang.CharacterDataXXX have multiple static final arrays, these are immutable, We should add `@Stable` and final to provide information to the optimizer.
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
>
> add '@stabletostatic final char[][][] charMap`, from @minborg
Nice refactoring.
As to C-style array rewrite, I am not so keen on that as they only appear in the generated source files, without any actual benefit.
src/java.base/share/classes/java/lang/CharacterData01.java.template line 30:
> 28: import jdk.internal.vm.annotation.Stable;
> 29:
> 30: /** The CharacterData class encapsulates the large tables once found in
Taking this opportunity, I'd rectify the comment here (and in other templates too): `CharacterData` -> `CharacterData01`
-------------
PR Review: https://git.openjdk.org/jdk/pull/25430#pullrequestreview-2871829996
PR Review Comment: https://git.openjdk.org/jdk/pull/25430#discussion_r2109689029
More information about the core-libs-dev
mailing list