On Sat, 23 May 2026 22:30:42 GMT, John R Rose <[email protected]> wrote:
>> Vladimir Ivanov has updated the pull request incrementally with three
>> additional commits since the last revision:
>>
>> - Merge remote-tracking branch 'origin/boolean_normalize' into
>> boolean_normalize
>> - update
>> - Truncate boolean values
>
> test/hotspot/jtreg/compiler/unsafe/UnsafeBooleanTest.java line 122:
>
>> 120: runTestsOn(prepare(name + " putBoolean",
>> TEST_PUT_BOOLEAN_MH, base, offset), value, true);
>> 121: runTestsOn(prepare(name + " getBoolean",
>> TEST_GET_BOOLEAN_MH, base, offset), value, false);
>> 122: }
>
> Do you mean to prepare all the tests multiple times, once per input value?
> Seems like a lot of duplication. The preparation is insensitive to the input
> value (the int with the boolean bit). This means that you are asking for a
> fresh warmed-up nmethod for each test case TIMES each each individual input
> value.
>
> Sketch of integrated perturbation of low bits plus test prep hoisting:
>
>
> Test[] getTests = prepare(…);
> Test[] putTests = prepare(…);
> Test[] allTests = prepare(…);
> for (int input : INPUTS) { // { 0, 2, 4, -1, … min and max values }
> for (int toggle : TOGGLES) { // { 0, 1, 0xFF }
> int value = input ^ toggle;
> System.out.printf(…);
> runTestsOn(getTests, …);
> runTestsOn(putTests, …);
> runTestsOn(allTests, …);
> }
> }
Good idea! Implemented.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31249#discussion_r3306523356