JDK-8081833 : Clean up JVMFlag getter/setter code
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-06-03
  • Updated: 2024-11-22
  • Resolved: 2020-09-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b17Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Description
In webrev email "Re: Revision2: Corrected: RFR 8059557 (XL): Validate JVM Command-Line Flag Arguments" Kim Barret commented:

There is a large amount of code near-duplication among the various
CommandLineFlagRange_<type> classes.  I think this could be
substantially reduced via some fairly straightforward usage of macros
and templates.  This can be dealt with in a follow-on cleanup - please
file a CR.

Probably similarly for the constraint classes. 

Comments
Changeset: 282b9dcf Author: Ioi Lam <iklam@openjdk.org> Date: 2020-09-22 06:04:31 +0000 URL: https://git.openjdk.java.net/jdk/commit/282b9dcf
22-09-2020

This will be fixed after JDK-8243208
02-09-2020

Unify get and set functions: https://cr.openjdk.java.net/~stefank/8081833/webrev.03.delta/ https://cr.openjdk.java.net/~stefank/8081833/webrev.03 Unify at and atPut functions: https://cr.openjdk.java.net/~stefank/8081833/webrev.04.delta/ https://cr.openjdk.java.net/~stefank/8081833/webrev.04 The last patch has the drawback that there's no (to me known) way to specialize is_type<size_t> and is_type<uint64_t>. So, is_size_t() and is_uint64_t() can't be implemented with is_type<T>. I implemented a flag_type_matches<T> function, that matches the type (size, sign) but not the original type. Left the is_size_t(), etc., flags for those places were we really want to check the original flag type. So far: Summary of changes: 1441 lines changed: 307 ins; 977 del; 157 mod; 14206 unchg
30-05-2019

webrev with both constraint and range changes: https://cr.openjdk.java.net/~stefank/8081833/webrev.02/ Next step is to unify JVMFlag::<type>At and JVMFlag::<type>AtPut functions for numreric types, and introduce JVMFlag<T>::at and JVMFlag<T>::atPut.
29-05-2019

[~coleenp] Prototype for the constraints classes: https://cr.openjdk.java.net/~stefank/8081833/webrev.01/ This one is much easier than the range implementation.
29-05-2019

If we're going to clean up argument processing, we should consider cleaning this up also. Reopening.
29-05-2019

Not a priority, closing as WNF.
30-03-2017