RFR: 8367397: Improve naming and terminology in regmask.hpp and regmask.cpp [v4]
Emanuel Peter
epeter at openjdk.org
Fri Sep 12 12:27:11 UTC 2025
On Thu, 11 Sep 2025 23:44:45 GMT, Dean Long <dlong at openjdk.org> wrote:
>> Thanks, I agree that it seems more consistent to use `_rm_int` and `_rm_word` instead. The missing leading underscore for `RM_SIZE_IN_INTS` highlights that it is a macro, unlike `_RM_SIZE_IN_WORDS`. Maybe this is just for historical reasons and not up to date with today's conventions?
>>
>> Do we classify constant static fields such as `_RM_SIZE_IN_WORDS` as constants or fields? I.e., do we use upper or lower case? I guess it would be `_rm_size_in_words` if considered a field and `RM_SIZE_IN_WORDS` (without the leading underscore) if considered a constant.
>
> I vote for `RM_SIZE_IN_WORDS` because it is a constant, the same as if it was a value from an enum.
Same as @dean-long : constants and enum values are generally `RM_SIZE_IN_WORDS`. Sometimes we also do `CamelCase`. Like for `LogBitsPerWord`. Underscore `_` is really only for fields.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27215#discussion_r2344084682
More information about the hotspot-compiler-dev
mailing list