RFR (S): 8146820: JVMCI properties should use HotSpotJVMCIRuntime.getBooleanProperty mechanism
Christian Thalinger
christian.thalinger at oracle.com
Tue Jan 12 22:39:32 UTC 2016
> On Jan 12, 2016, at 12:14 PM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>
>>
>> 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/ <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
…and this is a bug, of course :-)
>
> I’m almost tempted to move InitTimer to another package, like jdk.vm.ci.common …
>
>>
>> -Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160112/ab339939/attachment-0001.html>
More information about the hotspot-compiler-dev
mailing list