RFR (XS) 8238909: x86_32 fails gtest:power_of_2
Claes Redestad
claes.redestad at oracle.com
Thu Feb 13 11:04:23 UTC 2020
On 2020-02-12 21:30, Aleksey Shipilev wrote:
> On 2/12/20 7:45 PM, Aleksey Shipilev wrote:
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8238909
>>
>> Fix:
>> https://cr.openjdk.java.net/~shade/8238909/webrev.01/
>
> Scratch that, Stefan suggested a cleaner version:
> https://cr.openjdk.java.net/~shade/8238909/webrev.02/
Looks good, and nice catch. The use of is_power_of_2 was carried
forward from a z-only helper method that is 64-bit only, so we all
missed that it might be problematic on 32-bit.
As a follow-up RFE (that I can volunteer to take care of) I'd suggest
moving is_power_of_2_t from align.hpp to powerOfTwo.hpp and invert the
dependency.
The methods in globalDefinitions are hard to disentangle. And my gut
feeling is that we should move away from any operations that uses
intptr_t as a type for arithmetic operations in favor of template
functions.
/Claes
More information about the hotspot-dev
mailing list