Mercurial > hg > truffle
annotate graal/com.oracle.jvmci.options/src/com/oracle/jvmci/options/OptionValue.java @ 21554:b1530a6cce8c
renamed com.oracle.graal.[debug|options|hotspotvmconfig]* modules to com.oracle.jvmci.[debug|options|hotspotvmconfig]* modules (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 26 May 2015 23:21:15 +0200 |
parents | graal/com.oracle.graal.options/src/com/oracle/graal/options/OptionValue.java@07f2a49f0bfb |
children | d563baeca9df |
rev | line source |
---|---|
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
21554
b1530a6cce8c
renamed com.oracle.graal.[debug|options|hotspotvmconfig]* modules to com.oracle.jvmci.[debug|options|hotspotvmconfig]* modules (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18935
diff
changeset
|
23 package com.oracle.jvmci.options; |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
25 import java.io.*; |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
26 import java.util.*; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
27 import java.util.Map.Entry; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
28 |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 /** |
9919
af909f4b80a9
options are grouped per top level class/interface when accessed via the service mechanism
Doug Simon <doug.simon@oracle.com>
parents:
9914
diff
changeset
|
30 * An option value. |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 */ |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
32 public class OptionValue<T> { |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 /** |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
35 * Temporarily changes the value for an option. The {@linkplain OptionValue#getValue() value} of |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
36 * {@code option} is set to {@code value} until {@link OverrideScope#close()} is called on the |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
37 * object returned by this method. |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
38 * <p> |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
39 * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
40 * used: |
14763 | 41 * |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
42 * <pre> |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
43 * try (OverrideScope s = OptionValue.override(myOption, myValue) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
44 * // code that depends on myOption == myValue |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
45 * } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
46 * </pre> |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
47 */ |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
48 public static OverrideScope override(OptionValue<?> option, Object value) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
49 OverrideScope current = getOverrideScope(); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
50 if (current == null) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
51 if (!value.equals(option.getValue())) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
52 return new SingleOverrideScope(option, value); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
53 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
54 Map<OptionValue<?>, Object> overrides = Collections.emptyMap(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
55 return new MultipleOverridesScope(current, overrides); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
56 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
57 return new MultipleOverridesScope(current, option, value); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
58 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
59 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
60 /** |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
61 * Temporarily changes the values for a set of options. The {@linkplain OptionValue#getValue() |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
62 * value} of each {@code option} in {@code overrides} is set to the corresponding {@code value} |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
63 * in {@code overrides} until {@link OverrideScope#close()} is called on the object returned by |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
64 * this method. |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
65 * <p> |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
66 * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
67 * used: |
14763 | 68 * |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
69 * <pre> |
14906 | 70 * Map<OptionValue, Object> overrides = new HashMap<>(); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
71 * overrides.put(myOption1, myValue1); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
72 * overrides.put(myOption2, myValue2); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
73 * try (OverrideScope s = OptionValue.override(overrides) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
74 * // code that depends on myOption == myValue |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
75 * } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
76 * </pre> |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
77 */ |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
78 public static OverrideScope override(Map<OptionValue<?>, Object> overrides) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
79 OverrideScope current = getOverrideScope(); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
80 if (current == null && overrides.size() == 1) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
81 Entry<OptionValue<?>, Object> single = overrides.entrySet().iterator().next(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
82 OptionValue<?> option = single.getKey(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
83 Object overrideValue = single.getValue(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
84 if (!overrideValue.equals(option.getValue())) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
85 return new SingleOverrideScope(option, overrideValue); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
86 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
87 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
88 return new MultipleOverridesScope(current, overrides); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
89 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
90 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
91 /** |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
92 * Temporarily changes the values for a set of options. The {@linkplain OptionValue#getValue() |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
93 * value} of each {@code option} in {@code overrides} is set to the corresponding {@code value} |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
94 * in {@code overrides} until {@link OverrideScope#close()} is called on the object returned by |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
95 * this method. |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
96 * <p> |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
97 * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
98 * used: |
14763 | 99 * |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
100 * <pre> |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
101 * try (OverrideScope s = OptionValue.override(myOption1, myValue1, myOption2, myValue2) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
102 * // code that depends on myOption == myValue |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
103 * } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
104 * </pre> |
14763 | 105 * |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
106 * @param overrides overrides in the form {@code [option1, override1, option2, override2, ...]} |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
107 */ |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
108 public static OverrideScope override(Object... overrides) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
109 OverrideScope current = getOverrideScope(); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
110 if (current == null && overrides.length == 2) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
111 OptionValue<?> option = (OptionValue<?>) overrides[0]; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
112 Object overrideValue = overrides[1]; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
113 if (!overrideValue.equals(option.getValue())) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
114 return new SingleOverrideScope(option, overrideValue); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
115 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
116 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
117 Map<OptionValue<?>, Object> map = Collections.emptyMap(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
118 for (int i = 0; i < overrides.length; i += 2) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
119 OptionValue<?> option = (OptionValue<?>) overrides[i]; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
120 Object overrideValue = overrides[i + 1]; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
121 if (!overrideValue.equals(option.getValue())) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
122 if (map.isEmpty()) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
123 map = new HashMap<>(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
124 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
125 map.put(option, overrideValue); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
126 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
127 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
128 return new MultipleOverridesScope(current, map); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
129 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
130 |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
131 private static final ThreadLocal<OverrideScope> overrideScopeTL = new ThreadLocal<>(); |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
132 |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
133 protected static OverrideScope getOverrideScope() { |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
134 return overrideScopeTL.get(); |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
135 } |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
136 |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
137 protected static void setOverrideScope(OverrideScope overrideScope) { |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
138 overrideScopeTL.set(overrideScope); |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
139 } |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
140 |
18683
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
141 private T initialValue; |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
142 |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
143 /** |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
144 * The raw option value. |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
145 */ |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
146 protected T value; |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
147 |
12671
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
148 private OptionDescriptor descriptor; |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
149 |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
150 private long reads; |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
151 private OptionValue<?> next; |
15040
288c23143d47
Fix most raw type references.
Josef Eisl <josef.eisl@jku.at>
parents:
14906
diff
changeset
|
152 private static OptionValue<?> head; |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
153 |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
154 private static final boolean ShowReadsHistogram = Boolean.getBoolean("graal.showOptionValueReadsHistogram"); |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
155 |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
156 private static void addToHistogram(OptionValue<?> option) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
157 if (ShowReadsHistogram) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
158 synchronized (OptionValue.class) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
159 option.next = head; |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
160 head = option; |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
161 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
162 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
163 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
164 |
18683
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
165 @SuppressWarnings("unchecked") |
9914
84890660eefb
cleaner implementation of stable options
Doug Simon <doug.simon@oracle.com>
parents:
9912
diff
changeset
|
166 public OptionValue(T value) { |
18683
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
167 this.initialValue = value; |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
168 this.value = (T) UNINITIALIZED; |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
169 addToHistogram(this); |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
170 } |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
171 |
9863
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
172 private static final Object UNINITIALIZED = "UNINITIALIZED"; |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
173 |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
174 /** |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
175 * Creates an uninitialized option value for a subclass that initializes itself |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
176 * {@link #initialValue() lazily}. |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
177 */ |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
178 @SuppressWarnings("unchecked") |
9914
84890660eefb
cleaner implementation of stable options
Doug Simon <doug.simon@oracle.com>
parents:
9912
diff
changeset
|
179 protected OptionValue() { |
18683
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
180 this.initialValue = (T) UNINITIALIZED; |
9863
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
181 this.value = (T) UNINITIALIZED; |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
182 addToHistogram(this); |
9863
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
183 } |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
184 |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
185 /** |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
186 * Lazy initialization of value. |
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
187 */ |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
188 protected T initialValue() { |
9863
b2141bc6e98e
option values are either initialized upon creation or they must provide a lazily initialized value
Doug Simon <doug.simon@oracle.com>
parents:
9849
diff
changeset
|
189 throw new InternalError("Uninitialized option value must override initialValue()"); |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
190 } |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
191 |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
192 /** |
12671
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
193 * Sets the descriptor for this option. |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
194 */ |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
195 public void setDescriptor(OptionDescriptor descriptor) { |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
196 this.descriptor = descriptor; |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
197 } |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
198 |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
199 /** |
18683
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
200 * Returns the descriptor for this option, if it has been set by |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
201 * {@link #setDescriptor(OptionDescriptor)}. |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
202 */ |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
203 public OptionDescriptor getDescriptor() { |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
204 return descriptor; |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
205 } |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
206 |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
207 /** |
12671
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
208 * Gets the name of this option. The name for an option value with a null |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
209 * {@linkplain #setDescriptor(OptionDescriptor) descriptor} is the value of |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
210 * {@link Object#toString()}. |
12671
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
211 */ |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
212 public String getName() { |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
213 return descriptor == null ? super.toString() : (descriptor.getDeclaringClass().getName() + "." + descriptor.getName()); |
12671
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
214 } |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
215 |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
216 @Override |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
217 public String toString() { |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
218 return getName() + "=" + getValue(); |
12671
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
219 } |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
220 |
582b3d24c6ad
record an OptionDescriptor in an OptionValue so that it can be queried for a name
Doug Simon <doug.simon@oracle.com>
parents:
9919
diff
changeset
|
221 /** |
18683
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
222 * The initial value specified in source code. The returned value is not affected by calls to |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
223 * {@link #setValue(Object)} or registering {@link OverrideScope}s. Therefore, it is also not |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
224 * affected by options set on the command line. |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
225 */ |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
226 public T getInitialValue() { |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
227 if (initialValue == UNINITIALIZED) { |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
228 initialValue = initialValue(); |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
229 } |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
230 return initialValue; |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
231 } |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
232 |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
233 /** |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
234 * Returns true if the option has the same value that was set in the source code. |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
235 */ |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
236 public boolean hasInitialValue() { |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
237 if (!(this instanceof StableOptionValue)) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
238 OverrideScope overrideScope = getOverrideScope(); |
18683
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
239 if (overrideScope != null) { |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
240 T override = overrideScope.getOverride(this); |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
241 if (override != null) { |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
242 return false; |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
243 } |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
244 } |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
245 } |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
246 return value == UNINITIALIZED || Objects.equals(value, getInitialValue()); |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
247 } |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
248 |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
249 /** |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
250 * Gets the value of this option. |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
251 */ |
9914
84890660eefb
cleaner implementation of stable options
Doug Simon <doug.simon@oracle.com>
parents:
9912
diff
changeset
|
252 public T getValue() { |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
253 if (ShowReadsHistogram) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
254 reads++; |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
255 } |
12674
ecd519b39f10
don't try and get override for StableOptionValues
Doug Simon <doug.simon@oracle.com>
parents:
12672
diff
changeset
|
256 if (!(this instanceof StableOptionValue)) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
257 OverrideScope overrideScope = getOverrideScope(); |
12674
ecd519b39f10
don't try and get override for StableOptionValues
Doug Simon <doug.simon@oracle.com>
parents:
12672
diff
changeset
|
258 if (overrideScope != null) { |
ecd519b39f10
don't try and get override for StableOptionValues
Doug Simon <doug.simon@oracle.com>
parents:
12672
diff
changeset
|
259 T override = overrideScope.getOverride(this); |
ecd519b39f10
don't try and get override for StableOptionValues
Doug Simon <doug.simon@oracle.com>
parents:
12672
diff
changeset
|
260 if (override != null) { |
ecd519b39f10
don't try and get override for StableOptionValues
Doug Simon <doug.simon@oracle.com>
parents:
12672
diff
changeset
|
261 return override; |
ecd519b39f10
don't try and get override for StableOptionValues
Doug Simon <doug.simon@oracle.com>
parents:
12672
diff
changeset
|
262 } |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
263 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
264 } |
18683
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
265 if (value != UNINITIALIZED) { |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
266 return value; |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
267 } else { |
823f499a247c
Store initial value (the value set in source code) of an option
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16871
diff
changeset
|
268 return getInitialValue(); |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
269 } |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
270 } |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
271 |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
272 /** |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
273 * Gets the values of this option including overridden values. |
14763 | 274 * |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
275 * @param c the collection to which the values are added. If null, one is allocated. |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
276 * @return the collection to which the values were added in order from most overridden to |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
277 * current value |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
278 */ |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
279 @SuppressWarnings("unchecked") |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
280 public Collection<T> getValues(Collection<T> c) { |
14763 | 281 Collection<T> values = c == null ? new ArrayList<>() : c; |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
282 if (!(this instanceof StableOptionValue)) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
283 OverrideScope overrideScope = getOverrideScope(); |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
284 if (overrideScope != null) { |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
285 overrideScope.getOverrides(this, (Collection<Object>) values); |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
286 } |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
287 } |
18685
18d0f83cd290
Add code missing in initial value handling for options
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18683
diff
changeset
|
288 if (value != UNINITIALIZED) { |
18d0f83cd290
Add code missing in initial value handling for options
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18683
diff
changeset
|
289 values.add(value); |
18d0f83cd290
Add code missing in initial value handling for options
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18683
diff
changeset
|
290 } else { |
18d0f83cd290
Add code missing in initial value handling for options
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18683
diff
changeset
|
291 values.add(getInitialValue()); |
18d0f83cd290
Add code missing in initial value handling for options
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18683
diff
changeset
|
292 } |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
293 return values; |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
294 } |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
295 |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
296 /** |
9914
84890660eefb
cleaner implementation of stable options
Doug Simon <doug.simon@oracle.com>
parents:
9912
diff
changeset
|
297 * Sets the value of this option. |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
298 */ |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
299 @SuppressWarnings("unchecked") |
9914
84890660eefb
cleaner implementation of stable options
Doug Simon <doug.simon@oracle.com>
parents:
9912
diff
changeset
|
300 public void setValue(Object v) { |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
301 this.value = (T) v; |
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
302 } |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
303 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
304 /** |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
305 * An object whose {@link #close()} method reverts the option value overriding initiated by |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
306 * {@link OptionValue#override(OptionValue, Object)} or {@link OptionValue#override(Map)}. |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
307 */ |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
308 public abstract static class OverrideScope implements AutoCloseable { |
16871
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
309 |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
310 private Map<DerivedOptionValue<?>, Object> derivedCache = null; |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
311 |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
312 public <T> T getDerived(DerivedOptionValue<T> key) { |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
313 if (derivedCache == null) { |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
314 derivedCache = new HashMap<>(); |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
315 } |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
316 @SuppressWarnings("unchecked") |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
317 T ret = (T) derivedCache.get(key); |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
318 if (ret == null) { |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
319 ret = key.createValue(); |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
320 derivedCache.put(key, ret); |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
321 } |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
322 return ret; |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
323 } |
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15040
diff
changeset
|
324 |
15040
288c23143d47
Fix most raw type references.
Josef Eisl <josef.eisl@jku.at>
parents:
14906
diff
changeset
|
325 abstract void addToInherited(Map<OptionValue<?>, Object> inherited); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
326 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
327 abstract <T> T getOverride(OptionValue<T> option); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
328 |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
329 abstract void getOverrides(OptionValue<?> option, Collection<Object> c); |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
330 |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
331 public abstract void close(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
332 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
333 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
334 static class SingleOverrideScope extends OverrideScope { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
335 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
336 private final OptionValue<?> option; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
337 private final Object value; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
338 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
339 public SingleOverrideScope(OptionValue<?> option, Object value) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
340 if (option instanceof StableOptionValue) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
341 throw new IllegalArgumentException("Cannot override stable option " + option); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
342 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
343 this.option = option; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
344 this.value = value; |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
345 setOverrideScope(this); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
346 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
347 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
348 @Override |
15040
288c23143d47
Fix most raw type references.
Josef Eisl <josef.eisl@jku.at>
parents:
14906
diff
changeset
|
349 void addToInherited(Map<OptionValue<?>, Object> inherited) { |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
350 inherited.put(option, value); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
351 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
352 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
353 @SuppressWarnings("unchecked") |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
354 @Override |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
355 <T> T getOverride(OptionValue<T> key) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
356 if (key == this.option) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
357 return (T) value; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
358 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
359 return null; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
360 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
361 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
362 @Override |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
363 void getOverrides(OptionValue<?> key, Collection<Object> c) { |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
364 if (key == this.option) { |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
365 c.add(value); |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
366 } |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
367 } |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
368 |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
369 @Override |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
370 public void close() { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
371 setOverrideScope(null); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
372 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
373 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
374 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
375 static class MultipleOverridesScope extends OverrideScope { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
376 final OverrideScope parent; |
15040
288c23143d47
Fix most raw type references.
Josef Eisl <josef.eisl@jku.at>
parents:
14906
diff
changeset
|
377 final Map<OptionValue<?>, Object> overrides; |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
378 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
379 public MultipleOverridesScope(OverrideScope parent, OptionValue<?> option, Object value) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
380 this.parent = parent; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
381 this.overrides = new HashMap<>(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
382 if (parent != null) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
383 parent.addToInherited(overrides); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
384 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
385 if (option instanceof StableOptionValue) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
386 throw new IllegalArgumentException("Cannot override stable option " + option); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
387 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
388 if (!value.equals(option.getValue())) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
389 this.overrides.put(option, value); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
390 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
391 if (!overrides.isEmpty()) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
392 setOverrideScope(this); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
393 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
394 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
395 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
396 MultipleOverridesScope(OverrideScope parent, Map<OptionValue<?>, Object> overrides) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
397 this.parent = parent; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
398 if (overrides.isEmpty() && parent == null) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
399 this.overrides = Collections.emptyMap(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
400 return; |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
401 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
402 this.overrides = new HashMap<>(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
403 if (parent != null) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
404 parent.addToInherited(this.overrides); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
405 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
406 for (Map.Entry<OptionValue<?>, Object> e : overrides.entrySet()) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
407 OptionValue<?> option = e.getKey(); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
408 if (option instanceof StableOptionValue) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
409 throw new IllegalArgumentException("Cannot override stable option " + option); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
410 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
411 if (!e.getValue().equals(option.getValue())) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
412 this.overrides.put(option, e.getValue()); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
413 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
414 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
415 if (!this.overrides.isEmpty()) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
416 setOverrideScope(this); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
417 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
418 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
419 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
420 @Override |
15040
288c23143d47
Fix most raw type references.
Josef Eisl <josef.eisl@jku.at>
parents:
14906
diff
changeset
|
421 void addToInherited(Map<OptionValue<?>, Object> inherited) { |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
422 if (parent != null) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
423 parent.addToInherited(inherited); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
424 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
425 inherited.putAll(overrides); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
426 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
427 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
428 @SuppressWarnings("unchecked") |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
429 @Override |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
430 <T> T getOverride(OptionValue<T> option) { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
431 return (T) overrides.get(option); |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
432 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
433 |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
434 @Override |
12735
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
435 void getOverrides(OptionValue<?> option, Collection<Object> c) { |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
436 Object v = overrides.get(option); |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
437 if (v != null) { |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
438 c.add(v); |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
439 } |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
440 if (parent != null) { |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
441 parent.getOverrides(option, c); |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
442 } |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
443 } |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
444 |
bb85b81258a0
modified OptionValue.toString() to use the current, possibly overriding value; added OptionValue.getValues()
Doug Simon <doug.simon@oracle.com>
parents:
12682
diff
changeset
|
445 @Override |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
446 public void close() { |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
447 if (!overrides.isEmpty()) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18685
diff
changeset
|
448 setOverrideScope(parent); |
12672
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
449 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
450 } |
38bf986ce231
added support for scoped overriding of OptionValues (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
12671
diff
changeset
|
451 } |
12682
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
452 |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
453 static { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
454 if (ShowReadsHistogram) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
455 Runtime.getRuntime().addShutdownHook(new Thread() { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
456 @Override |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
457 public void run() { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
458 ArrayList<OptionValue<?>> options = new ArrayList<>(); |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
459 for (OptionValue<?> option = head; option != null; option = option.next) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
460 options.add(option); |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
461 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
462 Collections.sort(options, new Comparator<OptionValue<?>>() { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
463 |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
464 public int compare(OptionValue<?> o1, OptionValue<?> o2) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
465 if (o1.reads < o2.reads) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
466 return -1; |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
467 } else if (o1.reads > o2.reads) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
468 return 1; |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
469 } else { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
470 return o1.getName().compareTo(o2.getName()); |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
471 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
472 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
473 }); |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
474 PrintStream out = System.out; |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
475 out.println("=== OptionValue reads histogram ==="); |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
476 for (OptionValue<?> option : options) { |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
477 out.println(option.reads + "\t" + option); |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
478 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
479 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
480 }); |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
481 } |
5dbfb4d5eaba
added a histogram to OptionValue (enabled by -Dgraal.showOptionValueReadsHistogram=true) to see which options are most frequently read
Doug Simon <doug.simon@oracle.com>
parents:
12674
diff
changeset
|
482 } |
9849
e876c2a6954f
extensible option system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
483 } |