43972
|
1 |
/*
|
54328
|
2 |
* Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
|
43972
|
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;
|
55509
|
29 |
import org.graalvm.compiler.options.OptionStability;
|
43972
|
30 |
import org.graalvm.compiler.options.OptionType;
|
|
31 |
|
|
32 |
/**
|
55509
|
33 |
* This class encapsulates options that control the behavior of the GraalVM compiler.
|
43972
|
34 |
*/
|
|
35 |
// @formatter:off
|
|
36 |
public final class GraalOptions {
|
|
37 |
|
|
38 |
@Option(help = "Use compiler intrinsifications.", type = OptionType.Debug)
|
46344
|
39 |
public static final OptionKey<Boolean> Intrinsify = new OptionKey<>(true);
|
43972
|
40 |
|
|
41 |
@Option(help = "Inline calls with monomorphic type profile.", type = OptionType.Expert)
|
46344
|
42 |
public static final OptionKey<Boolean> InlineMonomorphicCalls = new OptionKey<>(true);
|
43972
|
43 |
|
|
44 |
@Option(help = "Inline calls with polymorphic type profile.", type = OptionType.Expert)
|
46344
|
45 |
public static final OptionKey<Boolean> InlinePolymorphicCalls = new OptionKey<>(true);
|
43972
|
46 |
|
|
47 |
@Option(help = "Inline calls with megamorphic type profile (i.e., not all types could be recorded).", type = OptionType.Expert)
|
46344
|
48 |
public static final OptionKey<Boolean> InlineMegamorphicCalls = new OptionKey<>(true);
|
43972
|
49 |
|
|
50 |
@Option(help = "Maximum desired size of the compiler graph in nodes.", type = OptionType.User)
|
46344
|
51 |
public static final OptionKey<Integer> MaximumDesiredSize = new OptionKey<>(20000);
|
43972
|
52 |
|
|
53 |
@Option(help = "Minimum probability for methods to be inlined for megamorphic type profiles.", type = OptionType.Expert)
|
46344
|
54 |
public static final OptionKey<Double> MegamorphicInliningMinMethodProbability = new OptionKey<>(0.33D);
|
43972
|
55 |
|
|
56 |
@Option(help = "Maximum level of recursive inlining.", type = OptionType.Expert)
|
46344
|
57 |
public static final OptionKey<Integer> MaximumRecursiveInlining = new OptionKey<>(5);
|
43972
|
58 |
|
|
59 |
@Option(help = "Graphs with less than this number of nodes are trivial and therefore always inlined.", type = OptionType.Expert)
|
46344
|
60 |
public static final OptionKey<Integer> TrivialInliningSize = new OptionKey<>(10);
|
43972
|
61 |
|
|
62 |
@Option(help = "Inlining is explored up to this number of nodes in the graph for each call site.", type = OptionType.Expert)
|
46344
|
63 |
public static final OptionKey<Integer> MaximumInliningSize = new OptionKey<>(300);
|
43972
|
64 |
|
|
65 |
@Option(help = "If the previous low-level graph size of the method exceeds the threshold, it is not inlined.", type = OptionType.Expert)
|
58299
|
66 |
public static final OptionKey<Integer> SmallCompiledLowLevelGraphSize = new OptionKey<>(330);
|
43972
|
67 |
|
|
68 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
69 |
public static final OptionKey<Double> LimitInlinedInvokes = new OptionKey<>(5.0);
|
43972
|
70 |
|
|
71 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
72 |
public static final OptionKey<Boolean> InlineEverything = new OptionKey<>(false);
|
43972
|
73 |
|
|
74 |
// escape analysis settings
|
|
75 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
76 |
public static final OptionKey<Boolean> PartialEscapeAnalysis = new OptionKey<>(true);
|
43972
|
77 |
|
|
78 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
79 |
public static final OptionKey<Integer> EscapeAnalysisIterations = new OptionKey<>(2);
|
43972
|
80 |
|
|
81 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
82 |
public static final OptionKey<Integer> EscapeAnalysisLoopCutoff = new OptionKey<>(20);
|
43972
|
83 |
|
|
84 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
85 |
public static final OptionKey<String> EscapeAnalyzeOnly = new OptionKey<>(null);
|
43972
|
86 |
|
54084
|
87 |
@Option(help = "The maximum length of an array that will be escape analyzed.", type = OptionType.Expert)
|
|
88 |
public static final OptionKey<Integer> MaximumEscapeAnalysisArrayLength = new OptionKey<>(128);
|
43972
|
89 |
|
|
90 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
91 |
public static final OptionKey<Boolean> PEAInliningHints = new OptionKey<>(false);
|
43972
|
92 |
|
|
93 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
94 |
public static final OptionKey<Double> TailDuplicationProbability = new OptionKey<>(0.5);
|
43972
|
95 |
|
|
96 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
97 |
public static final OptionKey<Integer> TailDuplicationTrivialSize = new OptionKey<>(1);
|
43972
|
98 |
|
|
99 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
100 |
public static final OptionKey<Integer> DeoptsToDisableOptimisticOptimization = new OptionKey<>(40);
|
43972
|
101 |
|
|
102 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
103 |
public static final OptionKey<Boolean> LoopPeeling = new OptionKey<>(true);
|
43972
|
104 |
|
|
105 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
106 |
public static final OptionKey<Boolean> ReassociateInvariants = new OptionKey<>(true);
|
43972
|
107 |
|
|
108 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
109 |
public static final OptionKey<Boolean> FullUnroll = new OptionKey<>(true);
|
43972
|
110 |
|
|
111 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
112 |
public static final OptionKey<Boolean> LoopUnswitch = new OptionKey<>(true);
|
43972
|
113 |
|
46640
|
114 |
@Option(help = "", type = OptionType.Debug)
|
|
115 |
public static final OptionKey<Boolean> PartialUnroll = new OptionKey<>(true);
|
|
116 |
|
43972
|
117 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
118 |
public static final OptionKey<Float> MinimumPeelProbability = new OptionKey<>(0.35f);
|
43972
|
119 |
|
|
120 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
121 |
public static final OptionKey<Integer> LoopMaxUnswitch = new OptionKey<>(3);
|
43972
|
122 |
|
|
123 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
124 |
public static final OptionKey<Boolean> UseLoopLimitChecks = new OptionKey<>(true);
|
43972
|
125 |
|
|
126 |
// debugging settings
|
|
127 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
128 |
public static final OptionKey<Boolean> ZapStackOnMethodEntry = new OptionKey<>(false);
|
43972
|
129 |
|
|
130 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
131 |
public static final OptionKey<Boolean> DeoptALot = new OptionKey<>(false);
|
43972
|
132 |
|
|
133 |
@Option(help = "Stress the code emitting explicit exception throwing code.", type = OptionType.Debug)
|
46344
|
134 |
public static final OptionKey<Boolean> StressExplicitExceptionCode = new OptionKey<>(false);
|
43972
|
135 |
|
|
136 |
@Option(help = "Stress the code emitting invokes with explicit exception edges.", type = OptionType.Debug)
|
46344
|
137 |
public static final OptionKey<Boolean> StressInvokeWithExceptionNode = new OptionKey<>(false);
|
|
138 |
|
|
139 |
@Option(help = "Stress the code by emitting reads at earliest instead of latest point.", type = OptionType.Debug)
|
|
140 |
public static final OptionKey<Boolean> StressTestEarlyReads = new OptionKey<>(false);
|
43972
|
141 |
|
|
142 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
143 |
public static final OptionKey<Boolean> VerifyPhases = new OptionKey<>(false);
|
43972
|
144 |
|
|
145 |
// Debug settings:
|
54084
|
146 |
@Option(help = "Start tracing compiled GC barriers after N garbage collections (disabled if N <= 0).", type = OptionType.Debug)
|
46344
|
147 |
public static final OptionKey<Integer> GCDebugStartCycle = new OptionKey<>(-1);
|
43972
|
148 |
|
|
149 |
@Option(help = "Perform platform dependent validation of the Java heap at returns", type = OptionType.Debug)
|
46344
|
150 |
public static final OptionKey<Boolean> VerifyHeapAtReturn = new OptionKey<>(false);
|
43972
|
151 |
|
|
152 |
// Other printing settings
|
|
153 |
@Option(help = "Print profiling information when parsing a method's bytecode", type = OptionType.Debug)
|
46344
|
154 |
public static final OptionKey<Boolean> PrintProfilingInformation = new OptionKey<>(false);
|
43972
|
155 |
|
|
156 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
157 |
public static final OptionKey<Boolean> TraceEscapeAnalysis = new OptionKey<>(false);
|
43972
|
158 |
|
|
159 |
// HotSpot command line options
|
|
160 |
@Option(help = "Print inlining optimizations", type = OptionType.Debug)
|
46344
|
161 |
public static final OptionKey<Boolean> HotSpotPrintInlining = new OptionKey<>(false);
|
43972
|
162 |
|
|
163 |
// Register allocator debugging
|
|
164 |
@Option(help = "Comma separated list of registers that register allocation is limited to.", type = OptionType.Debug)
|
46344
|
165 |
public static final OptionKey<String> RegisterPressure = new OptionKey<>(null);
|
43972
|
166 |
|
|
167 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
168 |
public static final OptionKey<Boolean> ConditionalElimination = new OptionKey<>(true);
|
43972
|
169 |
|
|
170 |
@Option(help = "", type = OptionType.Debug)
|
55509
|
171 |
public static final OptionKey<Integer> ConditionalEliminationMaxIterations = new OptionKey<>(4);
|
|
172 |
|
|
173 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
174 |
public static final OptionKey<Boolean> RawConditionalElimination = new OptionKey<>(true);
|
43972
|
175 |
|
|
176 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
177 |
public static final OptionKey<Boolean> ReplaceInputsWithConstantsBasedOnStamps = new OptionKey<>(true);
|
43972
|
178 |
|
|
179 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
180 |
public static final OptionKey<Boolean> RemoveNeverExecutedCode = new OptionKey<>(true);
|
43972
|
181 |
|
|
182 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
183 |
public static final OptionKey<Boolean> UseExceptionProbability = new OptionKey<>(true);
|
43972
|
184 |
|
|
185 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
186 |
public static final OptionKey<Boolean> OmitHotExceptionStacktrace = new OptionKey<>(false);
|
43972
|
187 |
|
|
188 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
189 |
public static final OptionKey<Boolean> GenSafepoints = new OptionKey<>(true);
|
43972
|
190 |
|
|
191 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
192 |
public static final OptionKey<Boolean> GenLoopSafepoints = new OptionKey<>(true);
|
|
193 |
|
|
194 |
@Option(help = "", type = OptionType.Debug)
|
|
195 |
public static final OptionKey<Boolean> UseTypeCheckHints = new OptionKey<>(true);
|
43972
|
196 |
|
|
197 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
198 |
public static final OptionKey<Boolean> InlineVTableStubs = new OptionKey<>(true);
|
43972
|
199 |
|
|
200 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
201 |
public static final OptionKey<Boolean> AlwaysInlineVTableStubs = new OptionKey<>(false);
|
43972
|
202 |
|
|
203 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
204 |
public static final OptionKey<Boolean> CanOmitFrame = new OptionKey<>(true);
|
43972
|
205 |
|
|
206 |
// Ahead of time compilation
|
|
207 |
@Option(help = "Try to avoid emitting code where patching is required", type = OptionType.Expert)
|
46344
|
208 |
public static final OptionKey<Boolean> ImmutableCode = new OptionKey<>(false);
|
43972
|
209 |
|
|
210 |
@Option(help = "Generate position independent code", type = OptionType.Expert)
|
46344
|
211 |
public static final OptionKey<Boolean> GeneratePIC = new OptionKey<>(false);
|
43972
|
212 |
|
|
213 |
// Runtime settings
|
|
214 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
215 |
public static final OptionKey<Boolean> SupportJsrBytecodes = new OptionKey<>(true);
|
43972
|
216 |
|
|
217 |
@Option(help = "", type = OptionType.Expert)
|
46344
|
218 |
public static final OptionKey<Boolean> OptAssumptions = new OptionKey<>(true);
|
43972
|
219 |
|
|
220 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
221 |
public static final OptionKey<Boolean> OptConvertDeoptsToGuards = new OptionKey<>(true);
|
43972
|
222 |
|
|
223 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
224 |
public static final OptionKey<Boolean> OptReadElimination = new OptionKey<>(true);
|
43972
|
225 |
|
|
226 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
227 |
public static final OptionKey<Integer> ReadEliminationMaxLoopVisits = new OptionKey<>(5);
|
43972
|
228 |
|
|
229 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
230 |
public static final OptionKey<Boolean> OptDeoptimizationGrouping = new OptionKey<>(true);
|
43972
|
231 |
|
|
232 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
233 |
public static final OptionKey<Boolean> OptScheduleOutOfLoops = new OptionKey<>(true);
|
43972
|
234 |
|
|
235 |
@Option(help = "", type = OptionType.Debug)
|
48861
|
236 |
public static final OptionKey<Boolean> GuardPriorities = new OptionKey<>(true);
|
|
237 |
|
|
238 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
239 |
public static final OptionKey<Boolean> OptEliminateGuards = new OptionKey<>(true);
|
43972
|
240 |
|
|
241 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
242 |
public static final OptionKey<Boolean> OptImplicitNullChecks = new OptionKey<>(true);
|
43972
|
243 |
|
|
244 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
245 |
public static final OptionKey<Boolean> OptLoopTransform = new OptionKey<>(true);
|
43972
|
246 |
|
|
247 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
248 |
public static final OptionKey<Boolean> OptFloatingReads = new OptionKey<>(true);
|
|
249 |
|
|
250 |
@Option(help = "", type = OptionType.Debug)
|
|
251 |
public static final OptionKey<Boolean> OptEliminatePartiallyRedundantGuards = new OptionKey<>(true);
|
43972
|
252 |
|
|
253 |
@Option(help = "", type = OptionType.Debug)
|
46344
|
254 |
public static final OptionKey<Boolean> OptFilterProfiledTypes = new OptionKey<>(true);
|
|
255 |
|
|
256 |
@Option(help = "", type = OptionType.Debug)
|
|
257 |
public static final OptionKey<Boolean> OptDevirtualizeInvokesOptimistically = new OptionKey<>(true);
|
43972
|
258 |
|
49451
|
259 |
@Option(help = "Track the NodeSourcePosition.", type = OptionType.Debug)
|
|
260 |
public static final OptionKey<Boolean> TrackNodeSourcePosition = new OptionKey<>(false);
|
|
261 |
|
49873
|
262 |
@Option(help = "Track source stack trace where a node was inserted into the graph.", type = OptionType.Debug)
|
|
263 |
public static final OptionKey<Boolean> TrackNodeInsertion = new OptionKey<>(false);
|
|
264 |
|
43972
|
265 |
@Option(help = "Allow backend to match complex expressions.", type = OptionType.Debug)
|
46344
|
266 |
public static final OptionKey<Boolean> MatchExpressions = new OptionKey<>(true);
|
43972
|
267 |
|
|
268 |
@Option(help = "Enable counters for various paths in snippets.", type = OptionType.Debug)
|
46344
|
269 |
public static final OptionKey<Boolean> SnippetCounters = new OptionKey<>(false);
|
43972
|
270 |
|
|
271 |
@Option(help = "Eagerly construct extra snippet info.", type = OptionType.Debug)
|
46344
|
272 |
public static final OptionKey<Boolean> EagerSnippets = new OptionKey<>(false);
|
43972
|
273 |
|
|
274 |
@Option(help = "Use a cache for snippet graphs.", type = OptionType.Debug)
|
46344
|
275 |
public static final OptionKey<Boolean> UseSnippetGraphCache = new OptionKey<>(true);
|
43972
|
276 |
|
55509
|
277 |
@Option(help = "file:doc-files/TraceInliningHelp.txt", type = OptionType.Debug, stability = OptionStability.STABLE)
|
49451
|
278 |
public static final OptionKey<Boolean> TraceInlining = new OptionKey<>(false);
|
48861
|
279 |
|
49873
|
280 |
@Option(help = "Enable inlining decision tracing in stubs and snippets.", type = OptionType.Debug)
|
|
281 |
public static final OptionKey<Boolean> TraceInliningForStubsAndSnippets = new OptionKey<>(false);
|
54328
|
282 |
|
54724
|
283 |
@Option(help = "Use Graal-generated stubs for complicated LIR operations instead of embedding all the emitted code.", type = OptionType.Expert)
|
54328
|
284 |
public static final OptionKey<Boolean> UseGraalStubs = new OptionKey<>(true);
|
|
285 |
|
54601
|
286 |
@Option(help = "Encode and decode snippets and substitutions before parsing to test libgraal code path. This option is ignored in the context of libgraal.")
|
|
287 |
public static final OptionKey<Boolean> UseEncodedGraphs = new OptionKey<>(false);
|
54724
|
288 |
|
|
289 |
@Option(help = "If applicable, use bulk zeroing instructions when the zeroing size in bytes exceeds this threshold.", type = OptionType.Expert)
|
|
290 |
public static final OptionKey<Integer> MinimalBulkZeroingSize = new OptionKey<>(2048);
|
|
291 |
|
57537
|
292 |
@Option(help = "Alignment in bytes for loop header blocks.", type = OptionType.Expert)
|
|
293 |
public static final OptionKey<Integer> LoopHeaderAlignment = new OptionKey<>(16);
|
43972
|
294 |
}
|