RFR: JDK-8310502 : Optimization for j.l.Long.fastUUID() [v26]

温绍锦 duke at openjdk.org
Tue Jun 27 16:18:21 UTC 2023


On Tue, 27 Jun 2023 14:32:14 GMT, Glavo <duke at openjdk.org> wrote:

>> On second thought, we should be able to create a getter like
>> 
>> @ForceInline
>> static short hex256(int byteValue) {
>>     return HEX256[byteValue];
>> }
>> 
>> and switch usages to that getter instead. This is a better approach than cloning the array and makes the array safe from modification by modules that get jdk.internal.util exports.
>
>> Sadly, jdk.internal.util is exported to other modules so it does need to be looked at from an integrity perspective.
> 
> This is indeed a problem to consider.
> 
> Maybe we can move this array back into `HexDigits`. Then we create a new package `jdk.internal.digits` and move `Digits`, `DecimalDigits`, `HexDigits`, `OctalDigits` all into it.

Hex256 has been moved to jdk.internal.digits, jdk.internal.digits is not exported.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14578#discussion_r1244011030


More information about the core-libs-dev mailing list