RFR: JDK-8300783: Consolidate byteswap implementations [v13]
Kim Barrett
kbarrett at openjdk.org
Fri Feb 17 05:42:01 UTC 2023
On Wed, 15 Feb 2023 15:34:41 GMT, Justin King <jcking at openjdk.org> wrote:
>> src/hotspot/share/utilities/moveBits.hpp line 53:
>>
>>> 51: template <typename T, ENABLE_IF(CanReverseBitsImpl<T>::value)>
>>> 52: ALWAYSINLINE T reverse_bits(T x) {
>>> 53: return ReverseBitsImpl<T>{}(x);
>>
>> I think I would have preferred to have the change to bit reversal by separate from byteswap changes.
>> With these changes, I also think this file should be renamed to reverse_bits.hpp or something like that.
>> It was called moveBits because it contained both bit and byte swapping.
>
> Out of curiosity, why `reverse_bits.hpp` instead of `reverseBits.hpp`? I have seen a few files in `utilities/` use the former, but the rest of Hotspot seems to always use the later? Is it because they contain a single function?
>
> I went with `reverse_bits.hpp` for now as suggested for consistency with the other bit fiddling headers in `utilities/`.
The usual camel-case with lowercase start convention typically refers to a class name in the file.
I'm not sure snake-case for files with a single function was a good idea, even though it might have
been my fault. But it's what we're doing (at least for now).
-------------
PR: https://git.openjdk.org/jdk/pull/12114
More information about the hotspot-jfr-dev
mailing list