Add @Stable to java.lang.CharacterDataLatin1 and other CharacterData classes
Chen Liang
chen.l.liang at oracle.com
Sun May 25 16:17:58 UTC 2025
On second thought, we should just focus on adding stable and final as you recommend - we should fix stylistic things with no semantic impact later.
________________________________
From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Chen Liang <chen.l.liang at oracle.com>
Sent: Saturday, May 24, 2025 6:16 PM
To: core-libs-dev <core-libs-dev at openjdk.org>; wenshao <shaojin.wensj at alibaba-inc.com>
Subject: Re: Add @Stable to java.lang.CharacterDataLatin1 and other CharacterData classes
Hello Shaojin,
I think your proposal is reasonable. These arrays are never mutated. Meanwhile I see some declarations like int A[] in CharacterData00, would be nice if you can convert those declarations to like int[] A too.
Regards,
Chen
________________________________
From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of wenshao <shaojin.wensj at alibaba-inc.com>
Sent: Saturday, May 24, 2025 12:55 PM
To: core-libs-dev <core-libs-dev at openjdk.org>
Subject: Add @Stable to java.lang.CharacterDataLatin1 and other CharacterData classes
Classes such as java.lang.CharacterDataXXX have multiple static final arrays, which will not be modified. We should add @Stable to provide information to the optimizer.
such as
```java
class CharacterData00 {
@Stable static final char[] X =
@Stable static final char[] Y =
@Stable static final int[] A =
@Stable static final char[] B =
}
```
-
Shaojin Wen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250525/22136f1b/attachment-0001.htm>
More information about the core-libs-dev
mailing list