Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/compiler/compiler_globals.hpp
40930 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, Tier3DelayOn, 5, \
217
"If C2 queue size grows over this amount per compiler thread " \
218
"stop compiling at tier 3 and start compiling at tier 2") \
219
range(0, max_jint) \
220
\
221
product(intx, Tier3DelayOff, 2, \
222
"If C2 queue size is less than this amount per compiler thread " \
223
"allow methods compiled at tier 2 transition to tier 3") \
224
range(0, max_jint) \
225
\
226
product(intx, Tier3LoadFeedback, 5, \
227
"Tier 3 thresholds will increase twofold when C1 queue size " \
228
"reaches this amount per compiler thread") \
229
range(0, max_jint) \
230
\
231
product(intx, Tier4LoadFeedback, 3, \
232
"Tier 4 thresholds will increase twofold when C2 queue size " \
233
"reaches this amount per compiler thread") \
234
range(0, max_jint) \
235
\
236
product(intx, TieredCompileTaskTimeout, 50, \
237
"Kill compile task if method was not used within " \
238
"given timeout in milliseconds") \
239
range(0, max_intx) \
240
\
241
product(intx, TieredStopAtLevel, 4, \
242
"Stop at given compilation level") \
243
range(0, 4) \
244
\
245
product(intx, Tier0ProfilingStartPercentage, 200, \
246
"Start profiling in interpreter if the counters exceed the " \
247
"specified percentage of tier 3 thresholds (tier 4 thresholds " \
248
"with CompilationMode=high-only|high-only-quick-internal)") \
249
range(0, max_jint) \
250
\
251
product(uintx, IncreaseFirstTierCompileThresholdAt, 50, \
252
"Increase the compile threshold for C1 compilation if the code " \
253
"cache is filled by the specified percentage") \
254
range(0, 99) \
255
\
256
product(intx, TieredRateUpdateMinTime, 1, \
257
"Minimum rate sampling interval (in milliseconds)") \
258
range(0, max_intx) \
259
\
260
product(intx, TieredRateUpdateMaxTime, 25, \
261
"Maximum rate sampling interval (in milliseconds)") \
262
range(0, max_intx) \
263
\
264
product(ccstr, CompilationMode, "default", \
265
"Compilation modes: " \
266
"default: normal tiered compilation; " \
267
"quick-only: C1-only mode; " \
268
"high-only: C2/JVMCI-only mode; " \
269
"high-only-quick-internal: C2/JVMCI-only mode, " \
270
"with JVMCI compiler compiled with C1.") \
271
\
272
product(bool, PrintTieredEvents, false, \
273
"Print tiered events notifications") \
274
\
275
product_pd(intx, OnStackReplacePercentage, \
276
"NON_TIERED number of method invocations/branches (expressed as " \
277
"% of CompileThreshold) before (re-)compiling OSR code") \
278
constraint(OnStackReplacePercentageConstraintFunc, AfterErgo) \
279
\
280
product(intx, InterpreterProfilePercentage, 33, \
281
"NON_TIERED number of method invocations/branches (expressed as " \
282
"% of CompileThreshold) before profiling in the interpreter") \
283
range(0, 100) \
284
\
285
/* compiler directives */ \
286
\
287
product(ccstrlist, CompileOnly, "", \
288
"List of methods (pkg/class.name) to restrict compilation to") \
289
\
290
product(ccstr, CompileCommandFile, NULL, \
291
"Read compiler commands from this file [.hotspot_compiler]") \
292
\
293
product(ccstr, CompilerDirectivesFile, NULL, DIAGNOSTIC, \
294
"Read compiler directives from this file") \
295
\
296
product(ccstrlist, CompileCommand, "", \
297
"Prepend to .hotspot_compiler; e.g. log,java/lang/String.<init>") \
298
\
299
develop(bool, ReplayCompiles, false, \
300
"Enable replay of compilations from ReplayDataFile") \
301
\
302
product(ccstr, ReplayDataFile, NULL, \
303
"File containing compilation replay information" \
304
"[default: ./replay_pid%p.log] (%p replaced with pid)") \
305
\
306
product(ccstr, InlineDataFile, NULL, \
307
"File containing inlining replay information" \
308
"[default: ./inline_pid%p.log] (%p replaced with pid)") \
309
\
310
develop(intx, ReplaySuppressInitializers, 2, \
311
"Control handling of class initialization during replay: " \
312
"0 - don't do anything special; " \
313
"1 - treat all class initializers as empty; " \
314
"2 - treat class initializers for application classes as empty; " \
315
"3 - allow all class initializers to run during bootstrap but " \
316
" pretend they are empty after starting replay") \
317
range(0, 3) \
318
\
319
develop(bool, ReplayIgnoreInitErrors, false, \
320
"Ignore exceptions thrown during initialization for replay") \
321
\
322
product(bool, DumpReplayDataOnError, true, \
323
"Record replay data for crashing compiler threads") \
324
\
325
product(bool, CompilerDirectivesIgnoreCompileCommands, false, DIAGNOSTIC, \
326
"Disable backwards compatibility for compile commands.") \
327
\
328
product(bool, CompilerDirectivesPrint, false, DIAGNOSTIC, \
329
"Print compiler directives on installation.") \
330
\
331
product(int, CompilerDirectivesLimit, 50, DIAGNOSTIC, \
332
"Limit on number of compiler directives.") \
333
\
334
/* Bytecode escape analysis estimation. */ \
335
\
336
product(bool, EstimateArgEscape, true, \
337
"Analyze bytecodes to estimate escape state of arguments") \
338
\
339
product(intx, BCEATraceLevel, 0, \
340
"How much tracing to do of bytecode escape analysis estimates " \
341
"(0-3)") \
342
range(0, 3) \
343
\
344
product(intx, MaxBCEAEstimateLevel, 5, \
345
"Maximum number of nested calls that are analyzed by BC EA") \
346
range(0, max_jint) \
347
\
348
product(intx, MaxBCEAEstimateSize, 150, \
349
"Maximum bytecode size of a method to be analyzed by BC EA") \
350
range(0, max_jint) \
351
\
352
/* misc compiler flags */ \
353
\
354
product(bool, AbortVMOnCompilationFailure, false, DIAGNOSTIC, \
355
"Abort VM when method had failed to compile.") \
356
\
357
develop(intx, OSROnlyBCI, -1, \
358
"OSR only at this bci. Negative values mean exclude that bci") \
359
\
360
develop(intx, DesiredMethodLimit, 8000, \
361
"The desired maximum method size (in bytecodes) after inlining") \
362
\
363
product(bool, DontCompileHugeMethods, true, \
364
"Do not compile methods > HugeMethodLimit") \
365
\
366
develop(intx, HugeMethodLimit, 8000, \
367
"Don't compile methods larger than this if " \
368
"+DontCompileHugeMethods") \
369
\
370
371
// end of COMPILER_FLAGS
372
373
DECLARE_FLAGS(COMPILER_FLAGS)
374
375
#endif // SHARE_COMPILER_COMPILER_GLOBALS_HPP
376
377