RFR (S): 8146820: JVMCI properties should use HotSpotJVMCIRuntime.getBooleanProperty mechanism

Doug Simon doug.simon at oracle.com
Tue Jan 12 22:03:04 UTC 2016


> On 12 Jan 2016, at 22:39, Christian Thalinger <christian.thalinger at oracle.com> wrote:
> 
>> 
>> On Jan 12, 2016, at 10:14 AM, Doug Simon <doug.simon at oracle.com> wrote:
>> 
>> If we’re going with an enum, you could put accessors directly in the enum:
>> 
>>   private static final boolean TrustFinalDefaultFields = Option.TrustFinalDefaultFields.getBoolean(true);
>> 
>>   private static final String TraceMethodDataFilter = Option.TraceMethodDataFilter.getString(null);
>> 
>> You could then type the value of the options and check the right accessor is used:
>> 
>>    public enum Option {
>>        ImplicitStableValues(boolean.class),
>>        InitTimer,  // Note: Not used because of visibility issues (see InitTimer.ENABLED).
>>        PrintConfig(boolean.class),
>>        PrintFlags(boolean.class),
>>        ShowFlags(boolean.class),
>>        TraceMethodDataFilter(String.class),
>>        TrustFinalDefaultFields(String.class);
>> 
>> Even ignoring these suggestions, the discipline imposed by the enum if a good idea.
> 
> Excellent idea!  I was also thinking about adding the default value to the enum.

Can you do that without having to box the default value?

-Doug


More information about the hotspot-compiler-dev mailing list