RFR: 8369685: RISC-V: refactor code related to RVFeatureValue::enabled [v4]

Robbin Ehn rehn at openjdk.org
Fri Oct 17 08:47:06 UTC 2025


On Fri, 17 Oct 2025 08:16:53 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Hmm ... But I find the only use of `value` in `VM_Version::setup_cpu_available_features()` is for `log_debug`:
>> 
>> 147       log_debug(os, cpu)("Enabled RV64 feature "%s" (%ld)",
>> 148              _feature_list[i]->pretty(),
>> 149              _feature_list[i]->value());
>> 
>> Can we simply move this to other methods like `enable_feature()` or `disable_feature()` in the subclasses? These are the places where we do the real enable / disable for them. If that make sense, then we would be able to make `value()` a method only for non-extensions. What do you think?
>
> Good idea. Maybe put them into `update_flag` instead? Or maybe a new method called `log_enabled` in `RVExtFeatures`? I prefer the latter.
> 
> @robehn how do you think about it? That means `value()` is only a method in `RVNonExtFeatureValue`.

Yes, that works.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27771#discussion_r2438886769


More information about the hotspot-dev mailing list