On Mon, 15 Jun 2026 14:36:15 GMT, Aleksey Shipilev <[email protected]> wrote:
>> Andrew Haley has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Work around Assembler bug.
>
> src/hotspot/share/runtime/javaThread.cpp line 429:
>
>> 427: int state;
>> 428: do {
>> 429: state = os::random();
>
> Tidbit: `os::random()` seems to be Park-Miller `mod (2**31-1)`, so the
> highest bit is always unset. Does it have impact on profiling? IOW, does any
> profiling code depends on all bits being uniformly distributed?
>
> It sounds from this code that we _do_ care about the highest bits?
>
>
> auto threshold = (UCONST64(1) << 32) >> ratio_shift;
> __ cmpl(r_profile_rng, threshold);
> __ jccb(Assembler::aboveEqual, nope);
Any nonzero starting point is fine. All we really need is for the top bits to
be uniformly distributed and uncorrelated with the program being run.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28541#discussion_r3421565686