RFR: 8283013: Simplify Arguments::parse_argument() [v3]

Calvin Cheung ccheung at openjdk.java.net
Wed Mar 30 15:51:39 UTC 2022


On Tue, 29 Mar 2022 05:41:19 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> - Remove all the complex `sscanf()` calls in `Arguments::parse_argument()`
>> - Call the appropriate parsing function according to the type of the flag
>> - Added more test cases for flags of the `double` type.
>> 
>> As a result of this change, `double` flags can now be specified in more ways, as long as the input is accepted by `strtod()`. However, `NaN` and `INFINITY` values are not allowed because the VM probably cannot handle them. Please see the test case for details.
>> 
>> Tested with tiers 1-5.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   moved comment

Looks good. I have a question.

src/hotspot/share/runtime/arguments.cpp line 1069:

> 1067: 
> 1068:   size_t name_len = size_t(arg - name);
> 1069:   JVMFlag* flag = find_jvm_flag(name, name_len);

Consider -XX:@blah
I think the name_len could be 0 if the preceding while loop did not increment the arg pointer.
But I think it is ok because find_jvm_flag would return NULL on a zero name_len.
Is it correct?

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

Marked as reviewed by ccheung (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7916


More information about the hotspot-dev mailing list