RFR (S): 8146820: JVMCI properties should use HotSpotJVMCIRuntime.getBooleanProperty mechanism
Christian Thalinger
christian.thalinger at oracle.com
Tue Jan 12 22:14:29 UTC 2016
> On Jan 12, 2016, at 12:03 PM, Doug Simon <doug.simon at oracle.com> wrote:
>
>>
>> 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?
No, we have to box but we can initialize all flags in the constructor:
http://cr.openjdk.java.net/~twisti/8146820/webrev.02/
We will not have many flags so this should be alright. A PrintFlags looks like this:
$ ./build/macosx-x86_64-normal-server-release/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.PrintFlags=true InitGraal
[List of JVMCI options]
boolean ImplicitStableValues := true
boolean InitTimer := false
boolean PrintConfig := false
boolean PrintFlags = true
boolean ShowFlags := false
String TraceMethodDataFilter := null
String TrustFinalDefaultFields := true
I’m almost tempted to move InitTimer to another package, like jdk.vm.ci.common …
>
> -Doug
More information about the hotspot-compiler-dev
mailing list