RFR: 8081833: Clean up JVMFlag getter/setter code [v2]
Gerard Ziemski
gziemski at openjdk.java.net
Thu Sep 17 16:21:21 UTC 2020
On Thu, 17 Sep 2020 00:39:43 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> src/hotspot/share/runtime/flags/jvmFlagLimit.cpp line 156:
>>
>>> 154: for (int i = 0; i < NUM_JVMFlagsEnum; i++) {
>>> 155: JVMFlagsEnum flag_enum = static_cast<JVMFlagsEnum>(i);
>>> 156: if (get_range_at(flag_enum) != NULL &&
>>
>> VMFlagAccess::check_range(JVMFlag::flag_from_enum(flag_enum) will check for "get_range_at(flag_enum) != NULL", so no
>> need for this check here?
>
> This function is called during VM start-up, so I want to short-circuit the check, and avoid calling
> VMFlagAccess::check_range if the flag has no ranges.
Nice
>> src/hotspot/share/runtime/flags/jvmFlagAccess.cpp line 91:
>>
>>> 89: public:
>>> 90: JVMFlag::Error set_impl(JVMFlag* flag, void* value_addr, JVMFlag::Flags origin) const {
>>> 91: bool verbose = !JVMFlagLimit::validated_after_ergo();
>>
>> Why only verbose when not AfterErgo? Maybe add comment explaining that.
>
> If I understand the old code correctly, we print out error messages only when parsing the command-line given by the
> user. When we later override values that are set programmatically by the FLAG_SET_XXX() macros, we don't print out
> error messages (or else the user will be confused). I will rewrite the code to make it clear, and add comments.
Thank you
-------------
PR: https://git.openjdk.java.net/jdk/pull/163
More information about the hotspot-dev
mailing list