On Sat, 23 May 2026 22:32:02 GMT, John R Rose <[email protected]> wrote:
>> Vladimir Ivanov has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> updates
>
> test/hotspot/jtreg/compiler/unsafe/UnsafeBooleanTest.java line 133:
>
>> 131: static void runTest(Test t, int value, boolean normalizedOnStore) {
>> 132: int expected = ((byte) value) & 1;
>> 133: for (int iter = 0; iter < 20_000; iter++) {
>
> This warmup is performed on each input value. If you hoist the test
> preparation, consider doing warmup loops elsewhere. But of course after the
> first input value triggers warmup, any further attempts to warm up will just
> go faster, if you reuse the test lambda.
>
> For a hoisted warmup, it is probably sufficient to pass `i&0xFF` or just `i`
> as the test value, where `i` is the counter from 0 to 20,000. I don’t think
> the compiler will try to reason about the range of the test value; the
> interpreter profile doesn’t record it. Nor are you doing data-dependent
> branches on it in your spun-up classfile.
It was needed for constant cases (`@Stable`) to work properly. I refactored
test logic and now it is only performed for constant test cases.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31249#discussion_r3306546517