Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/jdk17u
Path: blob/master/src/hotspot/share/compiler/compiler_globals.hpp
64440 views
1
/*
2
* Copyright (c) 1997, 2021, 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
*
23
*/
24
25
#ifndef SHARE_COMPILER_COMPILER_GLOBALS_HPP
26
#define SHARE_COMPILER_COMPILER_GLOBALS_HPP
27
28
#include "compiler/compiler_globals_pd.hpp"
29
#include "runtime/globals_shared.hpp"
30
#ifdef COMPILER1
31
#include "c1/c1_globals.hpp"
32
#endif // COMPILER1
33
#ifdef COMPILER2
34
#include "opto/c2_globals.hpp"
35
#endif // COMPILER2
36
#if INCLUDE_JVMCI
37
#include "jvmci/jvmci_globals.hpp"
38
#endif
39
40
// TODO -- currently, even if all JIT compilers are disabled, the following flags
41
// are still available in HotSpot. This should eventually be fixed ...
42
43
#define COMPILER_FLAGS(develop, \
44
develop_pd, \
45
product, \
46
product_pd, \
47
notproduct, \
48
range, \
49
constraint) \
50
\
51
/* compiler interface */ \
52
\
53
develop(bool, CIPrintCompilerName, false, \
54
"when CIPrint is active, print the name of the active compiler") \
55
\
56
product(bool, CIPrintCompileQueue, false, DIAGNOSTIC, \
57
"display the contents of the compile queue whenever a " \
58
"compilation is enqueued") \
59
\
60
develop(bool, CIPrintRequests, false, \
61
"display every request for compilation") \
62
\
63
product(bool, CITime, false, \
64
"collect timing information for compilation") \
65
\
66
develop(bool, CITimeVerbose, false, \
67
"be more verbose in compilation timings") \
68
\
69
develop(bool, CITimeEach, false, \
70
"display timing information after each successful compilation") \
71
\
72
develop(bool, CICountOSR, false, \
73
"use a separate counter when assigning ids to osr compilations") \
74
\
75
develop(bool, CICompileNatives, true, \
76
"compile native methods if supported by the compiler") \
77
\
78
develop_pd(bool, CICompileOSR, \
79
"compile on stack replacement methods if supported by the " \
80
"compiler") \
81
\
82
develop(bool, CIPrintMethodCodes, false, \
83
"print method bytecodes of the compiled code") \
84
\
85
develop(bool, CIPrintTypeFlow, false, \
86
"print the results of ciTypeFlow analysis") \
87
\
88
develop(bool, CITraceTypeFlow, false, \
89
"detailed per-bytecode tracing of ciTypeFlow analysis") \
90
\
91
product(bool, CICompilerCountPerCPU, false, \
92
"1 compiler thread for log(N CPUs)") \
93
\
94
notproduct(intx, CICrashAt, -1, \
95
"id of compilation to trigger assert in compiler thread for " \
96
"the purpose of testing, e.g. generation of replay data") \
97
\
98
notproduct(bool, CIObjectFactoryVerify, false, \
99
"enable potentially expensive verification in ciObjectFactory") \
100
\
101
develop(intx, CIStart, 0, \
102
"The id of the first compilation to permit") \
103
\
104
develop(intx, CIStop, max_jint, \
105
"The id of the last compilation to permit") \
106
\
107
develop(intx, CIStartOSR, 0, \
108
"The id of the first osr compilation to permit " \
109
"(CICountOSR must be on)") \
110
\
111
develop(intx, CIStopOSR, max_jint, \
112
"The id of the last osr compilation to permit " \
113
"(CICountOSR must be on)") \
114
\
115
develop(intx, CIBreakAtOSR, -1, \
116
"The id of osr compilation to break at") \
117
\
118
develop(intx, CIBreakAt, -1, \
119
"The id of compilation to break at") \
120
\
121
/* recompilation */ \
122
\
123
product(double, CompileThresholdScaling, 1.0, \
124
"Factor to control when first compilation happens " \
125
"(both with and without tiered compilation): " \
126
"values greater than 1.0 delay counter overflow, " \
127
"values between 0 and 1.0 rush counter overflow, " \
128
"value of 1.0 leaves compilation thresholds unchanged " \
129
"value of 0.0 is equivalent to -Xint. " \
130
"" \
131
"Flag can be set as per-method option. " \
132
"If a value is specified for a method, compilation thresholds " \
133
"for that method are scaled by both the value of the global flag "\
134
"and the value of the per-method flag.") \
135
range(0.0, DBL_MAX) \
136
\
137
product(intx, Tier0InvokeNotifyFreqLog, 7, \
138
"Interpreter (tier 0) invocation notification frequency") \
139
range(0, 30) \
140
\
141
product(intx, Tier2InvokeNotifyFreqLog, 11, \
142
"C1 without MDO (tier 2) invocation notification frequency") \
143
range(0, 30) \
144
\
145
product(intx, Tier3InvokeNotifyFreqLog, 10, \
146
"C1 with MDO profiling (tier 3) invocation notification " \
147
"frequency") \
148
range(0, 30) \
149
\
150
product(intx, Tier23InlineeNotifyFreqLog, 20, \
151
"Inlinee invocation (tiers 2 and 3) notification frequency") \
152
range(0, 30) \
153
\
154
product(intx, Tier0BackedgeNotifyFreqLog, 10, \
155
"Interpreter (tier 0) invocation notification frequency") \
156
range(0, 30) \
157
\
158
product(intx, Tier2BackedgeNotifyFreqLog, 14, \
159
"C1 without MDO (tier 2) invocation notification frequency") \
160
range(0, 30) \
161
\
162
product(intx, Tier3BackedgeNotifyFreqLog, 13, \
163
"C1 with MDO profiling (tier 3) invocation notification " \
164
"frequency") \
165
range(0, 30) \
166
\
167
product(intx, Tier2CompileThreshold, 0, \
168
"threshold at which tier 2 compilation is invoked") \
169
range(0, max_jint) \
170
\
171
product(intx, Tier2BackEdgeThreshold, 0, \
172
"Back edge threshold at which tier 2 compilation is invoked") \
173
range(0, max_jint) \
174
\
175
product(intx, Tier3InvocationThreshold, 200, \
176
"Compile if number of method invocations crosses this " \
177
"threshold") \
178
range(0, max_jint) \
179
\
180
product(intx, Tier3MinInvocationThreshold, 100, \
181
"Minimum invocation to compile at tier 3") \
182
range(0, max_jint) \
183
\
184
product(intx, Tier3CompileThreshold, 2000, \
185
"Threshold at which tier 3 compilation is invoked (invocation " \
186
"minimum must be satisfied)") \
187
range(0, max_jint) \
188
\
189
product(intx, Tier3BackEdgeThreshold, 60000, \
190
"Back edge threshold at which tier 3 OSR compilation is invoked") \
191
range(0, max_jint) \
192
\
193
product(intx, Tier4InvocationThreshold, 5000, \
194
"Compile if number of method invocations crosses this " \
195
"threshold") \
196
range(0, max_jint) \
197
\
198
product(intx, Tier4MinInvocationThreshold, 600, \
199
"Minimum invocation to compile at tier 4") \
200
range(0, max_jint) \
201
\
202
product(intx, Tier4CompileThreshold, 15000, \
203
"Threshold at which tier 4 compilation is invoked (invocation " \
204
"minimum must be satisfied)") \
205
range(0, max_jint) \
206
\
207
product(intx, Tier4BackEdgeThreshold, 40000, \
208
"Back edge threshold at which tier 4 OSR compilation is invoked") \
209
range(0, max_jint) \
210
\
211
product(intx, Tier0Delay, 20, DIAGNOSTIC, \
212
"If C2 queue size grows over this amount per compiler thread " \
213
"do not start profiling in the interpreter") \
214
range(0, max_jint) \
215
\
216
product(intx, TieredOldPercentage, 1000, DIAGNOSTIC, \
217
"Percentage over tier 3 thresholds after which a method is " \
218
"considered old (turns off parts of prioritization based on " \
219
"compile queue length)") \
220
range(0, max_jint) \
221
\
222
product(intx, Tier3DelayOn, 5, \
223
"If C2 queue size grows over this amount per compiler thread " \
224
"stop compiling at tier 3 and start compiling at tier 2") \
225
range(0, max_jint) \
226
\
227
product(intx, Tier3DelayOff, 2, \
228
"If C2 queue size is less than this amount per compiler thread " \
229
"allow methods compiled at tier 2 transition to tier 3") \
230
range(0, max_jint) \
231
\
232
product(intx, Tier3LoadFeedback, 5, \
233
"Tier 3 thresholds will increase twofold when C1 queue size " \
234
"reaches this amount per compiler thread") \
235
range(0, max_jint) \
236
\
237
product(intx, Tier4LoadFeedback, 3, \
238
"Tier 4 thresholds will increase twofold when C2 queue size " \
239
"reaches this amount per compiler thread") \
240
range(0, max_jint) \
241
\
242
product(intx, TieredCompileTaskTimeout, 50, \
243
"Kill compile task if method was not used within " \
244
"given timeout in milliseconds") \
245
range(0, max_intx) \
246
\
247
product(intx, TieredStopAtLevel, 4, \
248
"Stop at given compilation level") \
249
range(0, 4) \
250
\
251
product(intx, Tier0ProfilingStartPercentage, 200, \
252
"Start profiling in interpreter if the counters exceed the " \
253
"specified percentage of tier 3 thresholds") \
254
range(0, max_jint) \
255
\
256
product(uintx, IncreaseFirstTierCompileThresholdAt, 50, \
257
"Increase the compile threshold for C1 compilation if the code " \
258
"cache is filled by the specified percentage") \
259
range(0, 99) \
260
\
261
product(intx, TieredRateUpdateMinTime, 1, \
262
"Minimum rate sampling interval (in milliseconds)") \
263
range(0, max_intx) \
264
\
265
product(intx, TieredRateUpdateMaxTime, 25, \
266
"Maximum rate sampling interval (in milliseconds)") \
267
range(0, max_intx) \
268
\
269
product(ccstr, CompilationMode, "default", \
270
"Compilation modes: " \
271
"default: normal tiered compilation; " \
272
"quick-only: C1-only mode; " \
273
"high-only: C2/JVMCI-only mode; " \
274
"high-only-quick-internal: C2/JVMCI-only mode, " \
275
"with JVMCI compiler compiled with C1.") \
276
\
277
product(bool, PrintTieredEvents, false, \
278
"Print tiered events notifications") \
279
\
280
product_pd(intx, OnStackReplacePercentage, \
281
"NON_TIERED number of method invocations/branches (expressed as " \
282
"% of CompileThreshold) before (re-)compiling OSR code") \
283
constraint(OnStackReplacePercentageConstraintFunc, AfterErgo) \
284
\
285
product(intx, InterpreterProfilePercentage, 33, \
286
"NON_TIERED number of method invocations/branches (expressed as " \
287
"% of CompileThreshold) before profiling in the interpreter") \
288
range(0, 100) \
289
\
290
/* compiler directives */ \
291
\
292
product(ccstrlist, CompileOnly, "", \
293
"List of methods (pkg/class.name) to restrict compilation to") \
294
\
295
product(ccstr, CompileCommandFile, NULL, \
296
"Read compiler commands from this file [.hotspot_compiler]") \
297
\
298
product(ccstr, CompilerDirectivesFile, NULL, DIAGNOSTIC, \
299
"Read compiler directives from this file") \
300
\
301
product(ccstrlist, CompileCommand, "", \
302
"Prepend to .hotspot_compiler; e.g. log,java/lang/String.<init>") \
303
\
304
develop(bool, ReplayCompiles, false, \
305
"Enable replay of compilations from ReplayDataFile") \
306
\
307
product(ccstr, ReplayDataFile, NULL, \
308
"File containing compilation replay information" \
309
"[default: ./replay_pid%p.log] (%p replaced with pid)") \
310
\
311
product(ccstr, InlineDataFile, NULL, \
312
"File containing inlining replay information" \
313
"[default: ./inline_pid%p.log] (%p replaced with pid)") \
314
\
315
develop(intx, ReplaySuppressInitializers, 2, \
316
"Control handling of class initialization during replay: " \
317
"0 - don't do anything special; " \
318
"1 - treat all class initializers as empty; " \
319
"2 - treat class initializers for application classes as empty; " \
320
"3 - allow all class initializers to run during bootstrap but " \
321
" pretend they are empty after starting replay") \
322
range(0, 3) \
323
\
324
develop(bool, ReplayIgnoreInitErrors, false, \
325
"Ignore exceptions thrown during initialization for replay") \
326
\
327
product(bool, DumpReplayDataOnError, true, \
328
"Record replay data for crashing compiler threads") \
329
\
330
product(bool, CompilerDirectivesIgnoreCompileCommands, false, DIAGNOSTIC, \
331
"Disable backwards compatibility for compile commands.") \
332
\
333
product(bool, CompilerDirectivesPrint, false, DIAGNOSTIC, \
334
"Print compiler directives on installation.") \
335
\
336
product(int, CompilerDirectivesLimit, 50, DIAGNOSTIC, \
337
"Limit on number of compiler directives.") \
338
\
339
/* Bytecode escape analysis estimation. */ \
340
\
341
product(bool, EstimateArgEscape, true, \
342
"Analyze bytecodes to estimate escape state of arguments") \
343
\
344
product(intx, BCEATraceLevel, 0, \
345
"How much tracing to do of bytecode escape analysis estimates " \
346
"(0-3)") \
347
range(0, 3) \
348
\
349
product(intx, MaxBCEAEstimateLevel, 5, \
350
"Maximum number of nested calls that are analyzed by BC EA") \
351
range(0, max_jint) \
352
\
353
product(intx, MaxBCEAEstimateSize, 150, \
354
"Maximum bytecode size of a method to be analyzed by BC EA") \
355
range(0, max_jint) \
356
\
357
/* misc compiler flags */ \
358
\
359
product(bool, AbortVMOnCompilationFailure, false, DIAGNOSTIC, \
360
"Abort VM when method had failed to compile.") \
361
\
362
develop(intx, OSROnlyBCI, -1, \
363
"OSR only at this bci. Negative values mean exclude that bci") \
364
\
365
develop(intx, DesiredMethodLimit, 8000, \
366
"The desired maximum method size (in bytecodes) after inlining") \
367
\
368
product(bool, DontCompileHugeMethods, true, \
369
"Do not compile methods > HugeMethodLimit") \
370
\
371
develop(intx, HugeMethodLimit, 8000, \
372
"Don't compile methods larger than this if " \
373
"+DontCompileHugeMethods") \
374
\
375
376
// end of COMPILER_FLAGS
377
378
DECLARE_FLAGS(COMPILER_FLAGS)
379
380
#endif // SHARE_COMPILER_COMPILER_GLOBALS_HPP
381
382