43972
|
1 |
/*
|
|
2 |
* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation.
|
|
8 |
*
|
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
13 |
* accompanied this code).
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License version
|
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 |
*
|
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
20 |
* or visit www.oracle.com if you need additional information or have any
|
|
21 |
* questions.
|
|
22 |
*/
|
50858
|
23 |
|
|
24 |
|
43972
|
25 |
package org.graalvm.compiler.core.common;
|
|
26 |
|
|
27 |
import org.graalvm.compiler.options.Option;
|
46640
|
28 |
import org.graalvm.compiler.options.OptionKey;
|
43972
|
29 |
import org.graalvm.compiler.options.OptionType;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* This class encapsulates options that control the behavior of the Graal compiler.
|
|
33 |
*/
|
|
34 |
// @formatter:off
|
|
35 |
public final class GraalOptions {
|
|
36 |
|
|
37 |
@Option(help = "Use compiler intrinsifications.", type = OptionType.Debug)
|
46344
|
38 |
public static final OptionKey<Boolean> Intrinsify = new OptionKey<>(true);
|
43972
|
39 |
|
|
40 |
@Option(help = "Inline calls with monomorphic type profile.", type = OptionType.Expert)
|
46344
|
41 |
public static final OptionKey<Boolean> InlineMonomorphicCalls = new OptionKey<>(true);
|
43972
|
42 |
|
|
43 |
@Option(help = "Inline calls with polymorphic type profile.", type = OptionType.Expert)
|
46344
|
44 |
public static final OptionKey<Boolean> InlinePolymorphicCalls = new OptionKey<>(true);
|
43972
|
45 |
|
|
46 |
@Option(help = "Inline calls with megamorphic type profile (i.e., not all types could be recorded).", type = OptionType.Expert)
|
46344
|
47 |
public static final OptionKey<Boolean> InlineMegamorphicCalls = new OptionKey<>(true);
|
43972
|
48 |
|
|
49 |
@Option(help = "Maximum desired size of the compiler graph in nodes.", type = OptionType.User)
|
46344
|
50 |
public static final OptionKey<Integer> MaximumDesiredSize = new OptionKey<>(20000);
|
43972
|
51 |
|
|
52 |
@Option(help = "Minimum probability for methods to be inlined for megamorphic type profiles.", type = OptionType.Expert)
|
46344
|
53 |
public static final OptionKey<Double> MegamorphicInliningMinMethodProbability = new OptionKey<>(0.33D);
|
43972
|
54 |
|
|
55 |
@Option(help = "Maximum level of recursive inlining.", type = OptionType.Expert)
|
46344
|
56 |
public static final OptionKey<Integer> MaximumRecursiveInlining = new OptionKey<>(5);
|
43972
|
57 |
|
|
58 |
@Option(help = "Graphs with less than this number of nodes are trivial and therefore always inlined.", type = OptionType.Expert)
|
46344
|
59 |
public static final OptionKey<Integer> TrivialInliningSize = new OptionKey<>(10);
|
43972
|
60 |
|
|
61 |
@Option(help = "Inlining is explored up to this number of nodes in the graph for each call site.", type = OptionType.Expert)
|
46344
|
62 |
public static final OptionKey<Integer> MaximumInliningSize = new OptionKey<>(300);
|
43972
|
63 |
|
|
64 |
@Option(help = "If the previous low-level graph size of the method exceeds the threshold, it is not inlined.", type = OptionType.Expert)
|
46344
|
65 |
public static final OptionKey<Integer> SmallCompiledLowLevelGraphSize = new OptionKey<>(300);
|
43972
|
66 |
|
|
67 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
68 |
public static final OptionKey<Double> LimitInlinedInvokes = new OptionKey<>(5.0);
|
43972
|
69 |
|
|
70 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
71 |
public static final OptionKey<Boolean> InlineEverything = new OptionKey<>(false);
|
43972
|
72 |
|
|
73 |
// escape analysis settings
|
|
74 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
75 |
public static final OptionKey<Boolean> PartialEscapeAnalysis = new OptionKey<>(true);
|
43972
|
76 |
|
|
77 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
78 |
public static final OptionKey<Integer> EscapeAnalysisIterations = new OptionKey<>(2);
|
43972
|
79 |
|
|
80 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
81 |
public static final OptionKey<Integer> EscapeAnalysisLoopCutoff = new OptionKey<>(20);
|
43972
|
82 |
|
|
83 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
84 |
public static final OptionKey<String> EscapeAnalyzeOnly = new OptionKey<>(null);
|
43972
|
85 |
|
|
86 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
87 |
public static final OptionKey<Integer> MaximumEscapeAnalysisArrayLength = new OptionKey<>(32);
|
43972
|
88 |
|
|
89 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
90 |
public static final OptionKey<Boolean> PEAInliningHints = new OptionKey<>(false);
|
43972
|
91 |
|
|
92 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
93 |
public static final OptionKey<Double> TailDuplicationProbability = new OptionKey<>(0.5);
|
43972
|
94 |
|
|
95 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
96 |
public static final OptionKey<Integer> TailDuplicationTrivialSize = new OptionKey<>(1);
|
43972
|
97 |
|
|
98 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
99 |
public static final OptionKey<Integer> DeoptsToDisableOptimisticOptimization = new OptionKey<>(40);
|
43972
|
100 |
|
|
101 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
102 |
public static final OptionKey<Boolean> LoopPeeling = new OptionKey<>(true);
|
43972
|
103 |
|
|
104 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
105 |
public static final OptionKey<Boolean> ReassociateInvariants = new OptionKey<>(true);
|
43972
|
106 |
|
|
107 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
108 |
public static final OptionKey<Boolean> FullUnroll = new OptionKey<>(true);
|
43972
|
109 |
|
|
110 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
111 |
public static final OptionKey<Boolean> LoopUnswitch = new OptionKey<>(true);
|
43972
|
112 |
|
46640
|
113 |
@Option(help = "", type = OptionType.Debug)
|
|
114 |
public static final OptionKey<Boolean> PartialUnroll = new OptionKey<>(true);
|
|
115 |
|
43972
|
116 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
117 |
public static final OptionKey<Float> MinimumPeelProbability = new OptionKey<>(0.35f);
|
43972
|
118 |
|
|
119 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
120 |
public static final OptionKey<Integer> LoopMaxUnswitch = new OptionKey<>(3);
|
43972
|
121 |
|
|
122 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
123 |
public static final OptionKey<Boolean> UseLoopLimitChecks = new OptionKey<>(true);
|
43972
|
124 |
|
|
125 |
// debugging settings
|
|
126 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
127 |
public static final OptionKey<Boolean> ZapStackOnMethodEntry = new OptionKey<>(false);
|
43972
|
128 |
|
|
129 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
130 |
public static final OptionKey<Boolean> DeoptALot = new OptionKey<>(false);
|
43972
|
131 |
|
|
132 |
@Option(help = "Stress the code emitting explicit exception throwing code.", type = OptionType.Debug)
|
46344
|
133 |
public static final OptionKey<Boolean> StressExplicitExceptionCode = new OptionKey<>(false);
|
43972
|
134 |
|
|
135 |
@Option(help = "Stress the code emitting invokes with explicit exception edges.", type = OptionType.Debug)
|
46344
|
136 |
public static final OptionKey<Boolean> StressInvokeWithExceptionNode = new OptionKey<>(false);
|
|
137 |
|
|
138 |
@Option(help = "Stress the code by emitting reads at earliest instead of latest point.", type = OptionType.Debug)
|
|
139 |
public static final OptionKey<Boolean> StressTestEarlyReads = new OptionKey<>(false);
|
43972
|
140 |
|
|
141 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
142 |
public static final OptionKey<Boolean> VerifyPhases = new OptionKey<>(false);
|
43972
|
143 |
|
|
144 |
// Debug settings:
|
|
145 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
146 |
public static final OptionKey<Integer> GCDebugStartCycle = new OptionKey<>(-1);
|
43972
|
147 |
|
|
148 |
@Option(help = "Perform platform dependent validation of the Java heap at returns", type = OptionType.Debug)
|
46344
|
149 |
public static final OptionKey<Boolean> VerifyHeapAtReturn = new OptionKey<>(false);
|
43972
|
150 |
|
|
151 |
// Other printing settings
|
|
152 |
@Option(help = "Print profiling information when parsing a method's bytecode", type = OptionType.Debug)
|
46344
|
153 |
public static final OptionKey<Boolean> PrintProfilingInformation = new OptionKey<>(false);
|
43972
|
154 |
|
|
155 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
156 |
public static final OptionKey<Boolean> TraceEscapeAnalysis = new OptionKey<>(false);
|
43972
|
157 |
|
|
158 |
// HotSpot command line options
|
|
159 |
@Option(help = "Print inlining optimizations", type = OptionType.Debug)
|
46344
|
160 |
public static final OptionKey<Boolean> HotSpotPrintInlining = new OptionKey<>(false);
|
43972
|
161 |
|
|
162 |
// Register allocator debugging
|
|
163 |
@Option(help = "Comma separated list of registers that register allocation is limited to.", type = OptionType.Debug)
|
46344
|
164 |
public static final OptionKey<String> RegisterPressure = new OptionKey<>(null);
|
43972
|
165 |
|
|
166 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
167 |
public static final OptionKey<Boolean> ConditionalElimination = new OptionKey<>(true);
|
43972
|
168 |
|
|
169 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
170 |
public static final OptionKey<Boolean> RawConditionalElimination = new OptionKey<>(true);
|
43972
|
171 |
|
|
172 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
173 |
public static final OptionKey<Boolean> ReplaceInputsWithConstantsBasedOnStamps = new OptionKey<>(true);
|
43972
|
174 |
|
|
175 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
176 |
public static final OptionKey<Boolean> RemoveNeverExecutedCode = new OptionKey<>(true);
|
43972
|
177 |
|
|
178 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
179 |
public static final OptionKey<Boolean> UseExceptionProbability = new OptionKey<>(true);
|
43972
|
180 |
|
|
181 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
182 |
public static final OptionKey<Boolean> OmitHotExceptionStacktrace = new OptionKey<>(false);
|
43972
|
183 |
|
|
184 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
185 |
public static final OptionKey<Boolean> GenSafepoints = new OptionKey<>(true);
|
43972
|
186 |
|
|
187 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
188 |
public static final OptionKey<Boolean> GenLoopSafepoints = new OptionKey<>(true);
|
|
189 |
|
|
190 |
@Option(help = "", type = OptionType.Debug)
|
|
191 |
public static final OptionKey<Boolean> UseTypeCheckHints = new OptionKey<>(true);
|
43972
|
192 |
|
|
193 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
194 |
public static final OptionKey<Boolean> InlineVTableStubs = new OptionKey<>(true);
|
43972
|
195 |
|
|
196 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
197 |
public static final OptionKey<Boolean> AlwaysInlineVTableStubs = new OptionKey<>(false);
|
43972
|
198 |
|
|
199 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
200 |
public static final OptionKey<Boolean> ResolveClassBeforeStaticInvoke = new OptionKey<>(false);
|
43972
|
201 |
|
|
202 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
203 |
public static final OptionKey<Boolean> CanOmitFrame = new OptionKey<>(true);
|
43972
|
204 |
|
|
205 |
// Ahead of time compilation
|
|
206 |
@Option(help = "Try to avoid emitting code where patching is required", type = OptionType.Expert)
|
46344
|
207 |
public static final OptionKey<Boolean> ImmutableCode = new OptionKey<>(false);
|
43972
|
208 |
|
|
209 |
@Option(help = "Generate position independent code", type = OptionType.Expert)
|
46344
|
210 |
public static final OptionKey<Boolean> GeneratePIC = new OptionKey<>(false);
|
43972
|
211 |
|
|
212 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
213 |
public static final OptionKey<Boolean> CallArrayCopy = new OptionKey<>(true);
|
43972
|
214 |
|
|
215 |
// Runtime settings
|
|
216 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
217 |
public static final OptionKey<Boolean> SupportJsrBytecodes = new OptionKey<>(true);
|
43972
|
218 |
|
|
219 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
220 |
public static final OptionKey<Boolean> OptAssumptions = new OptionKey<>(true);
|
43972
|
221 |
|
|
222 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
223 |
public static final OptionKey<Boolean> OptConvertDeoptsToGuards = new OptionKey<>(true);
|
43972
|
224 |
|
|
225 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
226 |
public static final OptionKey<Boolean> OptReadElimination = new OptionKey<>(true);
|
43972
|
227 |
|
|
228 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
229 |
public static final OptionKey<Integer> ReadEliminationMaxLoopVisits = new OptionKey<>(5);
|
43972
|
230 |
|
|
231 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
232 |
public static final OptionKey<Boolean> OptDeoptimizationGrouping = new OptionKey<>(true);
|
43972
|
233 |
|
|
234 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
235 |
public static final OptionKey<Boolean> OptScheduleOutOfLoops = new OptionKey<>(true);
|
43972
|
236 |
|
|
237 |
@Option(help = "", type = OptionType.Debug)
|
48861
|
238 |
public static final OptionKey<Boolean> GuardPriorities = new OptionKey<>(true);
|
|
239 |
|
|
240 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
241 |
public static final OptionKey<Boolean> OptEliminateGuards = new OptionKey<>(true);
|
43972
|
242 |
|
|
243 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
244 |
public static final OptionKey<Boolean> OptImplicitNullChecks = new OptionKey<>(true);
|
43972
|
245 |
|
|
246 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
247 |
public static final OptionKey<Boolean> OptClearNonLiveLocals = new OptionKey<>(true);
|
43972
|
248 |
|
|
249 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
250 |
public static final OptionKey<Boolean> OptLoopTransform = new OptionKey<>(true);
|
43972
|
251 |
|
|
252 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
253 |
public static final OptionKey<Boolean> OptFloatingReads = new OptionKey<>(true);
|
|
254 |
|
|
255 |
@Option(help = "", type = OptionType.Debug)
|
|
256 |
public static final OptionKey<Boolean> OptEliminatePartiallyRedundantGuards = new OptionKey<>(true);
|
43972
|
257 |
|
|
258 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
259 |
public static final OptionKey<Boolean> OptFilterProfiledTypes = new OptionKey<>(true);
|
|
260 |
|
|
261 |
@Option(help = "", type = OptionType.Debug)
|
|
262 |
public static final OptionKey<Boolean> OptDevirtualizeInvokesOptimistically = new OptionKey<>(true);
|
43972
|
263 |
|
49451
|
264 |
@Option(help = "Track the NodeSourcePosition.", type = OptionType.Debug)
|
|
265 |
public static final OptionKey<Boolean> TrackNodeSourcePosition = new OptionKey<>(false);
|
|
266 |
|
49873
|
267 |
@Option(help = "Track source stack trace where a node was inserted into the graph.", type = OptionType.Debug)
|
|
268 |
public static final OptionKey<Boolean> TrackNodeInsertion = new OptionKey<>(false);
|
|
269 |
|
43972
|
270 |
@Option(help = "Allow backend to match complex expressions.", type = OptionType.Debug)
|
46344
|
271 |
public static final OptionKey<Boolean> MatchExpressions = new OptionKey<>(true);
|
43972
|
272 |
|
|
273 |
@Option(help = "Enable counters for various paths in snippets.", type = OptionType.Debug)
|
46344
|
274 |
public static final OptionKey<Boolean> SnippetCounters = new OptionKey<>(false);
|
43972
|
275 |
|
|
276 |
@Option(help = "Eagerly construct extra snippet info.", type = OptionType.Debug)
|
46344
|
277 |
public static final OptionKey<Boolean> EagerSnippets = new OptionKey<>(false);
|
43972
|
278 |
|
|
279 |
@Option(help = "Use a cache for snippet graphs.", type = OptionType.Debug)
|
46344
|
280 |
public static final OptionKey<Boolean> UseSnippetGraphCache = new OptionKey<>(true);
|
43972
|
281 |
|
|
282 |
@Option(help = "Enable experimental Trace Register Allocation.", type = OptionType.Debug)
|
46344
|
283 |
public static final OptionKey<Boolean> TraceRA = new OptionKey<>(false);
|
49873
|
284 |
|
|
285 |
@Option(help = "file:doc-files/TraceInliningHelp.txt", type = OptionType.Debug)
|
49451
|
286 |
public static final OptionKey<Boolean> TraceInlining = new OptionKey<>(false);
|
48861
|
287 |
|
49873
|
288 |
@Option(help = "Enable inlining decision tracing in stubs and snippets.", type = OptionType.Debug)
|
|
289 |
public static final OptionKey<Boolean> TraceInliningForStubsAndSnippets = new OptionKey<>(false);
|
43972
|
290 |
}
|