RFR: 8282773: Refactor parsing of integer VM options [v3]
Ioi Lam
iklam at openjdk.java.net
Fri Mar 11 08:24:46 UTC 2022
On Thu, 10 Mar 2022 05:33:34 GMT, David Holmes <dholmes at openjdk.org> wrote:
> Looks good.
>
> The test is rather hard to decipher. I see my requested min +/- 1 and max +/- 1 added, but other boundary cases are not obvious e.g. to test nK for example, we want to check n = (max/K)-1; (max/K); (max/K)+1 and similarly around min. And then the same for M, G, T
I updated the test to check for all edge cases of k/m/g/t suffixes.
> src/hotspot/share/runtime/arguments.cpp line 945:
>
>> 943: // point character (.)
>> 944: // If a string looks like a FP number, it would be parsed by
>> 945: // set_fp_numeric_flag(). See Arguments::parse_argument().
>
> Okay but ... can't we create a double from a string that represents a number larger than can be parsed as a long? Anyway I'm just surprised that we wouldn't use the type of the flag to determine whether to use set_numeric_flag or set_fp_numeric_flag, and so always use strod for double flags, regardless of the format of the value.
I filed https://bugs.openjdk.java.net/browse/JDK-8283013 -- "strtod should always be used to parse double VM arguments"
-------------
PR: https://git.openjdk.java.net/jdk/pull/7763
More information about the hotspot-runtime-dev
mailing list