Revision1: Corrected: RFR 8059557 (XL): Validate JVM Command-Line Flag Arguments

Gerard Ziemski gerard.ziemski at oracle.com
Wed May 27 21:06:34 UTC 2015



On 5/27/2015 3:38 PM, David Holmes wrote:
>
>> Constraints are called whenever the flag in question changes its value
>> (via CommandLineFlags::*AtPut  for those flags set by external tools
>> like jcmd), and also a final check is run
>> (CommandLineFlags::check_all_ranges_and_constraints()) right after
>> Arguments::apply_ergo(), at which point it is assumed that all flags
>> have their final values set.
>
> Ok. So I would specify the constraint function on each of the flags 
> involved. When the flags are processed individually the constraint 
> check may not make sense (because they don't have their final values) 
> so the constraint function will be predicated on 
> CommandLineFlags::finishedInitializing().

That's indeed why we introduced CommandLineFlags::finishedInitializing() 
API - it might not be perfect (maybe I should have named it finalCheck() 
instead?), but given the way current code works and the new requirements 
coming from JEP (changing writeable flags values must be 
range/constraint validated) it does the job.

Thank you for taking the time to raise questions and providing feedback.


cheers



More information about the hotspot-dev mailing list