RFR: 8369685: RISC-V: refactor code related to RVFeatureValue::enabled [v2]
Robbin Ehn
rehn at openjdk.org
Thu Oct 16 10:01:50 UTC 2025
On Wed, 15 Oct 2025 08:38:42 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/vm_version_riscv.hpp line 160:
>>
>>> 158: RVExtFeatures::current()->clear_feature(_cpu_feature_index);
>>> 159: }
>>> 160: int64_t value() { return enabled(); }
>>
>> Seems redundant in functionality with `enabled()` for extension features. I think this `value()` method should only apply to non-extension features.
>
> Same as the above one. In `VM_Version::setup_cpu_available_features()`, we still need it.
automatically C style conversion between booleans and integer should be avoided.
(pointer to as bool strictly no no)
And I'm confused:
Disabled value == DEFAULT_VALUE (-1)
But enabled returns 0 or 1 convertet from bool?
{ return enabled() ? _what_value_here : DEFAULT_VALUE; } ?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27771#discussion_r2435304826
More information about the hotspot-dev
mailing list