RFR: 8367397: Improve naming and terminology in regmask.hpp and regmask.cpp [v2]

Dean Long dlong at openjdk.org
Thu Sep 11 23:50:23 UTC 2025


On Thu, 11 Sep 2025 13:40:35 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:

>> Generally, we use `_` for fields, but not for constants.
>> Also: fields should be lower-case, so maybe `_RM_INT` -> `_rm_int`?
>
> 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.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27215#discussion_r2342592026


More information about the hotspot-compiler-dev mailing list