1 /*
2 * Copyright (c) 1997, 2025, 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_RUNTIME_GLOBALS_HPP
26 #define SHARE_RUNTIME_GLOBALS_HPP
27
28 #include "compiler/compiler_globals_pd.hpp"
29 #include "runtime/globals_shared.hpp"
30 #include "utilities/align.hpp"
31 #include "utilities/globalDefinitions.hpp"
32 #include "utilities/macros.hpp"
33 #include CPU_HEADER(globals)
34 #include OS_HEADER(globals)
35 #include OS_CPU_HEADER(globals)
36
37 // develop flags are settable / visible only during development and are constant in the PRODUCT version
38 // product flags are always settable / visible
39 // develop_pd/product_pd flags are the same as develop/product, except that their default values
40 // are specified in platform-dependent header files.
41
42 // Flags must be declared with the following number of parameters:
43 // non-pd flags:
44 // (type, name, default_value, doc), or
45 // (type, name, default_value, extra_attrs, doc)
46 // pd flags:
47 // (type, name, doc), or
48 // (type, name, extra_attrs, doc)
49
50 // A flag must be declared with one of the following types:
51 // bool, int, uint, intx, uintx, size_t, ccstr, ccstrlist, double, or uint64_t.
52 // The type "ccstr" and "ccstrlist" are an alias for "const char*" and is used
53 // only in this file, because the macrology requires single-token type names.
54
55 // The optional extra_attrs parameter may have one of the following values:
56 // DIAGNOSTIC, EXPERIMENTAL, or MANAGEABLE. Currently extra_attrs can be used
57 // only with product/product_pd flags.
58 //
59 // DIAGNOSTIC options are not meant for VM tuning or for product modes.
60 // They are to be used for VM quality assurance or field diagnosis
61 // of VM bugs. They are hidden so that users will not be encouraged to
62 // try them as if they were VM ordinary execution options. However, they
63 // are available in the product version of the VM. Under instruction
64 // from support engineers, VM customers can turn them on to collect
65 // diagnostic information about VM problems. To use a VM diagnostic
66 // option, you must first specify +UnlockDiagnosticVMOptions.
67 // (This master switch also affects the behavior of -Xprintflags.)
68 //
69 // EXPERIMENTAL flags are in support of features that may not be
70 // an officially supported part of a product, but may be available
71 // for experimenting with. They could, for example, be performance
72 // features that may not have undergone full or rigorous QA, but which may
73 // help performance in some cases and released for experimentation
74 // by the community of users and developers. This flag also allows one to
75 // be able to build a fully supported product that nonetheless also
76 // ships with some unsupported, lightly tested, experimental features.
77 // Refer to the documentation of any products using this code for details
78 // on support and fitness for production.
79 // Like the UnlockDiagnosticVMOptions flag above, there is a corresponding
80 // UnlockExperimentalVMOptions flag, which allows the control and
81 // modification of the experimental flags.
82 //
83 // Nota bene: neither diagnostic nor experimental options should be used casually,
84 // Refer to the documentation of any products using this code for details.
85 //
86 // MANAGEABLE flags are writeable external product flags.
87 // They are dynamically writeable through the JDK management interface
88 // (com.sun.management.HotSpotDiagnosticMXBean API) and also through JConsole.
89 // These flags are external exported interface (see CSR). The list of
90 // manageable flags can be queried programmatically through the management
91 // interface.
92 //
93 // A flag can be made as "manageable" only if
94 // - the flag is defined in a CSR request as an external exported interface.
95 // - the VM implementation supports dynamic setting of the flag.
96 // This implies that the VM must *always* query the flag variable
97 // and not reuse state related to the flag state at any given time.
98 // - you want the flag to be queried programmatically by the customers.
99 //
100
101 //
102 // range is a macro that will expand to min and max arguments for range
103 // checking code if provided - see jvmFlagLimit.hpp
104 //
105 // constraint is a macro that will expand to custom function call
106 // for constraint checking if provided - see jvmFlagLimit.hpp
107
108 // Default and minimum StringTable and SymbolTable size values
109 // Must be powers of 2
110 const size_t defaultStringTableSize = NOT_LP64(1024) LP64_ONLY(65536);
111 const size_t minimumStringTableSize = 128;
112 const size_t defaultSymbolTableSize = 32768; // 2^15
113 const size_t minimumSymbolTableSize = 1024;
114
115 #ifdef _LP64
116 #define LP64_RUNTIME_FLAGS(develop, \
117 develop_pd, \
118 product, \
119 product_pd, \
120 range, \
121 constraint) \
122 \
123 product(bool, UseCompressedOops, false, \
124 "Use 32-bit object references in 64-bit VM. " \
125 "lp64_product means flag is always constant in 32 bit VM") \
126 \
127 product(bool, UseCompactObjectHeaders, false, \
128 "Use compact 64-bit object headers in 64-bit VM") \
129 \
130 product(int, ObjectAlignmentInBytes, 8, \
131 "Default object alignment in bytes, 8 is minimum") \
132 range(8, 256) \
133 constraint(ObjectAlignmentInBytesConstraintFunc, AtParse)
134
135 #else
136 // !_LP64
137
138 #define LP64_RUNTIME_FLAGS(develop, \
139 develop_pd, \
140 product, \
141 product_pd, \
142 range, \
143 constraint)
144 const bool UseCompressedOops = false;
145 const bool UseCompactObjectHeaders = false;
146 const int ObjectAlignmentInBytes = 8;
147
148 #endif // _LP64
149
150 #define RUNTIME_FLAGS(develop, \
151 develop_pd, \
152 product, \
153 product_pd, \
154 range, \
155 constraint) \
156 \
157 develop(bool, CheckCompressedOops, true, \
158 "Generate checks in encoding/decoding code in debug VM") \
159 \
160 product(uintx, HeapSearchSteps, 3 PPC64_ONLY(+17), \
161 "Heap allocation steps through preferred address regions to find" \
162 " where it can allocate the heap. Number of steps to take per " \
163 "region.") \
164 range(1, max_uintx) \
165 \
166 product(uint, HandshakeTimeout, 0, DIAGNOSTIC, \
167 "If nonzero set a timeout in milliseconds for handshakes") \
168 \
169 product(bool, AlwaysSafeConstructors, false, EXPERIMENTAL, \
170 "Force safe construction, as if all fields are final.") \
171 \
172 product(bool, UnlockDiagnosticVMOptions, trueInDebug, DIAGNOSTIC, \
173 "Enable normal processing of flags relating to field diagnostics")\
174 \
175 product(bool, UnlockExperimentalVMOptions, false, EXPERIMENTAL, \
176 "Enable normal processing of flags relating to experimental " \
177 "features") \
178 \
179 product(bool, JavaMonitorsInStackTrace, true, \
180 "Print information about Java monitor locks when the stacks are " \
181 "dumped") \
182 \
183 product_pd(bool, UseLargePages, \
184 "Use large page memory") \
185 \
186 product_pd(bool, UseLargePagesIndividualAllocation, \
187 "Allocate large pages individually for better affinity") \
188 \
189 develop(bool, LargePagesIndividualAllocationInjectError, false, \
190 "Fail large pages individual allocation") \
191 \
192 product(bool, UseNUMA, false, \
193 "Use NUMA if available") \
194 \
195 product(bool, UseNUMAInterleaving, false, \
196 "Interleave memory across NUMA nodes if available") \
197 \
198 product(size_t, NUMAInterleaveGranularity, 2*M, \
199 "Granularity to use for NUMA interleaving on Windows OS") \
200 constraint(NUMAInterleaveGranularityConstraintFunc, AtParse) \
201 \
202 product(uintx, NUMAChunkResizeWeight, 20, \
203 "Percentage (0-100) used to weight the current sample when " \
204 "computing exponentially decaying average for " \
205 "AdaptiveNUMAChunkSizing") \
206 range(0, 100) \
207 \
208 product(size_t, NUMASpaceResizeRate, 1*G, \
209 "Do not reallocate more than this amount per collection") \
210 range(0, max_uintx) \
211 \
212 product(bool, UseAdaptiveNUMAChunkSizing, true, \
213 "Enable adaptive chunk sizing for NUMA") \
214 \
215 product(bool, NUMAStats, false, \
216 "Print NUMA stats in detailed heap information") \
217 \
218 product(bool, UseAES, false, \
219 "Control whether AES instructions are used when available") \
220 \
221 product(bool, UseFMA, false, \
222 "Control whether FMA instructions are used when available") \
223 \
224 product(bool, UseSHA, false, \
225 "Control whether SHA instructions are used when available") \
226 \
227 product(bool, UseGHASHIntrinsics, false, DIAGNOSTIC, \
228 "Use intrinsics for GHASH versions of crypto") \
229 \
230 product(bool, UseBASE64Intrinsics, false, \
231 "Use intrinsics for java.util.Base64") \
232 \
233 product(bool, UsePoly1305Intrinsics, false, DIAGNOSTIC, \
234 "Use intrinsics for sun.security.util.math.intpoly") \
235 product(bool, UseIntPolyIntrinsics, false, DIAGNOSTIC, \
236 "Use intrinsics for sun.security.util.math.intpoly.MontgomeryIntegerPolynomialP256") \
237 \
238 product(size_t, LargePageSizeInBytes, 0, \
239 "Maximum large page size used (0 will use the default large " \
240 "page size for the environment as the maximum) " \
241 "(must be a power of 2)") \
242 range(0, max_uintx) \
243 constraint(LargePageSizeInBytesConstraintFunc, AtParse) \
244 \
245 product(size_t, LargePageHeapSizeThreshold, 128*M, \
246 "Use large pages if maximum heap is at least this big") \
247 range(0, max_uintx) \
248 \
249 product(bool, ForceTimeHighResolution, false, \
250 "Using high time resolution (for Win32 only)") \
251 \
252 develop(bool, TracePcPatching, false, \
253 "Trace usage of frame::patch_pc") \
254 \
255 develop(bool, TraceRelocator, false, \
256 "Trace the bytecode relocator") \
257 \
258 \
259 product(bool, SafepointALot, false, DIAGNOSTIC, \
260 "Generate a lot of safepoints. This works with " \
261 "GuaranteedSafepointInterval") \
262 \
263 product(bool, HandshakeALot, false, DIAGNOSTIC, \
264 "Generate a lot of handshakes. This works with " \
265 "GuaranteedSafepointInterval") \
266 \
267 product_pd(bool, BackgroundCompilation, \
268 "A thread requesting compilation is not blocked during " \
269 "compilation") \
270 \
271 product(bool, MethodFlushing, true, \
272 "Reclamation of compiled methods") \
273 \
274 develop(bool, VerifyStack, false, \
275 "Verify stack of each thread when it is entering a runtime call") \
276 \
277 product(bool, ForceUnreachable, false, DIAGNOSTIC, \
278 "Make all non code cache addresses to be unreachable by " \
279 "forcing use of 64bit literal fixups") \
280 \
281 develop(bool, TraceDerivedPointers, false, \
282 "Trace traversal of derived pointers on stack") \
283 \
284 develop(bool, TraceCodeBlobStacks, false, \
285 "Trace stack-walk of codeblobs") \
286 \
287 develop(bool, PrintRewrites, false, \
288 "Print methods that are being rewritten") \
289 \
290 product(bool, UseInlineCaches, true, \
291 "Use Inline Caches for virtual calls ") \
292 \
293 develop(bool, VerifyInlineCaches, true, \
294 "Verify Inline Caches") \
295 \
296 product(bool, InlineArrayCopy, true, DIAGNOSTIC, \
297 "Inline arraycopy native that is known to be part of " \
298 "base library DLL") \
299 \
300 product(bool, InlineObjectHash, true, DIAGNOSTIC, \
301 "Inline Object::hashCode() native that is known to be part " \
302 "of base library DLL") \
303 \
304 product(bool, InlineNatives, true, DIAGNOSTIC, \
305 "Inline natives that are known to be part of base library DLL") \
306 \
307 product(bool, InlineMathNatives, true, DIAGNOSTIC, \
308 "Inline SinD, CosD, etc.") \
309 \
310 product(bool, InlineClassNatives, true, DIAGNOSTIC, \
311 "Inline Class.isInstance, etc") \
312 \
313 product(bool, InlineThreadNatives, true, DIAGNOSTIC, \
314 "Inline Thread.currentThread, etc") \
315 \
316 product(bool, InlineUnsafeOps, true, DIAGNOSTIC, \
317 "Inline memory ops (native methods) from Unsafe") \
318 \
319 product(bool, UseAESIntrinsics, false, DIAGNOSTIC, \
320 "Use intrinsics for AES versions of crypto") \
321 \
322 product(bool, UseAESCTRIntrinsics, false, DIAGNOSTIC, \
323 "Use intrinsics for the paralleled version of AES/CTR crypto") \
324 \
325 product(bool, UseChaCha20Intrinsics, false, DIAGNOSTIC, \
326 "Use intrinsics for the vectorized version of ChaCha20") \
327 \
328 product(bool, UseKyberIntrinsics, false, DIAGNOSTIC, \
329 "Use intrinsics for the vectorized version of Kyber") \
330 \
331 product(bool, UseDilithiumIntrinsics, false, DIAGNOSTIC, \
332 "Use intrinsics for the vectorized version of Dilithium") \
333 \
334 product(bool, UseMD5Intrinsics, false, DIAGNOSTIC, \
335 "Use intrinsics for MD5 crypto hash function") \
336 \
337 product(bool, UseSHA1Intrinsics, false, DIAGNOSTIC, \
338 "Use intrinsics for SHA-1 crypto hash function. " \
339 "Requires that UseSHA is enabled.") \
340 \
341 product(bool, UseSHA256Intrinsics, false, DIAGNOSTIC, \
342 "Use intrinsics for SHA-224 and SHA-256 crypto hash functions. " \
343 "Requires that UseSHA is enabled.") \
344 \
345 product(bool, UseSHA512Intrinsics, false, DIAGNOSTIC, \
346 "Use intrinsics for SHA-384 and SHA-512 crypto hash functions. " \
347 "Requires that UseSHA is enabled.") \
348 \
349 product(bool, UseSHA3Intrinsics, false, DIAGNOSTIC, \
350 "Use intrinsics for SHA3 crypto hash function. " \
351 "Requires that UseSHA is enabled.") \
352 \
353 product(bool, UseCRC32Intrinsics, false, DIAGNOSTIC, \
354 "use intrinsics for java.util.zip.CRC32") \
355 \
356 product(bool, UseCRC32CIntrinsics, false, DIAGNOSTIC, \
357 "use intrinsics for java.util.zip.CRC32C") \
358 \
359 product(bool, UseAdler32Intrinsics, false, DIAGNOSTIC, \
360 "use intrinsics for java.util.zip.Adler32") \
361 \
362 product(bool, UseVectorizedMismatchIntrinsic, false, DIAGNOSTIC, \
363 "Enables intrinsification of ArraysSupport.vectorizedMismatch()") \
364 \
365 product(bool, UseVectorizedHashCodeIntrinsic, false, DIAGNOSTIC, \
366 "Enables intrinsification of ArraysSupport.vectorizedHashCode()") \
367 \
368 product(bool, UseCopySignIntrinsic, false, DIAGNOSTIC, \
369 "Enables intrinsification of Math.copySign") \
370 \
371 product(bool, UseSignumIntrinsic, false, DIAGNOSTIC, \
372 "Enables intrinsification of Math.signum") \
373 \
374 product_pd(bool, DelayCompilerStubsGeneration, DIAGNOSTIC, \
375 "Use Compiler thread for compiler's stubs generation") \
376 \
377 product(ccstrlist, DisableIntrinsic, "", DIAGNOSTIC, \
378 "do not expand intrinsics whose (internal) names appear here") \
379 constraint(DisableIntrinsicConstraintFunc,AfterErgo) \
380 \
381 product(ccstrlist, ControlIntrinsic, "", DIAGNOSTIC, \
382 "Control intrinsics using a list of +/- (internal) names, " \
383 "separated by commas") \
384 constraint(ControlIntrinsicConstraintFunc,AfterErgo) \
385 \
386 develop(bool, TraceCallFixup, false, \
387 "Trace all call fixups") \
388 \
389 develop(bool, DeoptimizeALot, false, \
390 "Deoptimize at every exit from the runtime system") \
391 \
392 develop(ccstrlist, DeoptimizeOnlyAt, "", \
393 "A comma separated list of bcis to deoptimize at") \
394 \
395 develop(bool, DeoptimizeRandom, false, \
396 "Deoptimize random frames on random exit from the runtime system")\
397 \
398 develop(bool, ZombieALot, false, \
399 "Create non-entrant nmethods at exit from the runtime system") \
400 \
401 develop(bool, WalkStackALot, false, \
402 "Trace stack (no print) at every exit from the runtime system") \
403 \
404 develop(bool, DeoptimizeObjectsALot, false, \
405 "For testing purposes concurrent threads revert optimizations " \
406 "based on escape analysis at intervals given with " \
407 "DeoptimizeObjectsALotInterval=n. The thread count is given " \
408 "with DeoptimizeObjectsALotThreadCountSingle and " \
409 "DeoptimizeObjectsALotThreadCountAll.") \
410 \
411 develop(uint64_t, DeoptimizeObjectsALotInterval, 5, \
412 "Interval for DeoptimizeObjectsALot.") \
413 range(0, max_jlong) \
414 \
415 develop(int, DeoptimizeObjectsALotThreadCountSingle, 1, \
416 "The number of threads that revert optimizations based on " \
417 "escape analysis for a single thread if DeoptimizeObjectsALot " \
418 "is enabled. The target thread is selected round robin." ) \
419 range(0, max_jint) \
420 \
421 develop(int, DeoptimizeObjectsALotThreadCountAll, 1, \
422 "The number of threads that revert optimizations based on " \
423 "escape analysis for all threads if DeoptimizeObjectsALot " \
424 "is enabled." ) \
425 range(0, max_jint) \
426 \
427 develop(bool, VerifyLastFrame, false, \
428 "Verify oops on last frame on entry to VM") \
429 \
430 product(bool, SafepointTimeout, false, \
431 "Time out and warn or fail after SafepointTimeoutDelay " \
432 "milliseconds if failed to reach safepoint") \
433 \
434 product(bool, AbortVMOnSafepointTimeout, false, DIAGNOSTIC, \
435 "Abort upon failure to reach safepoint (see SafepointTimeout)") \
436 \
437 product(uint64_t, AbortVMOnSafepointTimeoutDelay, 0, DIAGNOSTIC, \
438 "Delay in milliseconds for option AbortVMOnSafepointTimeout") \
439 range(0, max_jlong) \
440 \
441 product(bool, AbortVMOnVMOperationTimeout, false, DIAGNOSTIC, \
442 "Abort upon failure to complete VM operation promptly") \
443 \
444 product(intx, AbortVMOnVMOperationTimeoutDelay, 1000, DIAGNOSTIC, \
445 "Delay in milliseconds for option AbortVMOnVMOperationTimeout") \
446 range(0, max_intx) \
447 \
448 product(bool, MaxFDLimit, true, \
449 "Bump the number of file descriptors to maximum (Unix only)") \
450 \
451 product(bool, LogEvents, true, DIAGNOSTIC, \
452 "Enable the various ring buffer event logs") \
453 \
454 product(int, LogEventsBufferEntries, 20, DIAGNOSTIC, \
455 "Number of ring buffer event logs") \
456 range(1, NOT_LP64(1*K) LP64_ONLY(1*M)) \
457 \
458 product(bool, BytecodeVerificationRemote, true, DIAGNOSTIC, \
459 "Enable the Java bytecode verifier for remote classes") \
460 \
461 product(bool, BytecodeVerificationLocal, false, DIAGNOSTIC, \
462 "Enable the Java bytecode verifier for local classes") \
463 \
464 develop(bool, VerifyStackAtCalls, false, \
465 "Verify that the stack pointer is unchanged after calls") \
466 \
467 develop(bool, TraceJavaAssertions, false, \
468 "Trace java language assertions") \
469 \
470 develop(bool, VerifyCodeCache, false, \
471 "Verify code cache on memory allocation/deallocation") \
472 \
473 develop(bool, ZapResourceArea, trueInDebug, \
474 "Zap freed resource/arena space") \
475 \
476 develop(bool, ZapVMHandleArea, trueInDebug, \
477 "Zap freed VM handle space") \
478 \
479 develop(bool, ZapStackSegments, trueInDebug, \
480 "Zap allocated/freed stack segments") \
481 \
482 develop(bool, ZapUnusedHeapArea, trueInDebug, \
483 "Zap unused heap space") \
484 \
485 develop(bool, ZapFillerObjects, trueInDebug, \
486 "Zap filler objects") \
487 \
488 develop(bool, ZapCHeap, trueInDebug, \
489 "Zap allocated/freed C heap space") \
490 \
491 develop(bool, ZapTLAB, trueInDebug, \
492 "Zap allocated TLABs") \
493 develop(bool, TestingAsyncLoggingDeathTest, false, \
494 "Recursive logging death test") \
495 develop(bool, TestingAsyncLoggingDeathTestNoCrash, false, \
496 "Recursive logging death test (no crash)") \
497 \
498 product(bool, ExecutingUnitTests, false, \
499 "Whether the JVM is running unit tests or not") \
500 \
501 develop(uint, ErrorHandlerTest, 0, \
502 "If > 0, provokes an error after VM initialization; the value " \
503 "determines which error to provoke. See controlled_crash() " \
504 "in vmError.cpp.") \
505 range(0, 18) \
506 \
507 develop(uint, TestCrashInErrorHandler, 0, \
508 "If > 0, provokes an error inside VM error handler (a secondary " \
509 "crash). see controlled_crash() in vmError.cpp") \
510 range(0, 17) \
511 \
512 develop(bool, TestSafeFetchInErrorHandler, false , \
513 "If true, tests SafeFetch inside error handler.") \
514 \
515 develop(bool, TestUnresponsiveErrorHandler, false, \
516 "If true, simulates an unresponsive error handler.") \
517 \
518 develop(bool, Verbose, false, \
519 "Print additional debugging information from other modes") \
520 \
521 develop(bool, PrintMiscellaneous, false, \
522 "Print uncategorized debugging information (requires +Verbose)") \
523 \
524 develop(bool, WizardMode, false, \
525 "Print much more debugging information") \
526 \
527 product(bool, ShowMessageBoxOnError, false, \
528 "Keep process alive on VM fatal error") \
529 \
530 product(bool, CreateCoredumpOnCrash, true, \
531 "Create core/mini dump on VM fatal error") \
532 \
533 product(uint64_t, ErrorLogTimeout, 2 * 60, \
534 "Timeout, in seconds, to limit the time spent on writing an " \
535 "error log in case of a crash.") \
536 range(0, (uint64_t)max_jlong/1000) \
537 \
538 product(bool, ErrorLogSecondaryErrorDetails, false, DIAGNOSTIC, \
539 "If enabled, show details on secondary crashes in the error log") \
540 \
541 develop(intx, TraceDwarfLevel, 0, \
542 "Debug levels for the dwarf parser") \
543 range(0, 4) \
544 \
545 product(bool, SuppressFatalErrorMessage, false, \
546 "Report NO fatal error message (avoid deadlock)") \
547 \
548 product(ccstrlist, OnError, "", \
549 "Run user-defined commands on fatal error; see VMError.cpp " \
550 "for examples") \
551 \
552 product(ccstrlist, OnOutOfMemoryError, "", \
553 "Run user-defined commands on first java.lang.OutOfMemoryError " \
554 "thrown from JVM") \
555 \
556 product(bool, HeapDumpBeforeFullGC, false, MANAGEABLE, \
557 "Dump heap to file before any major stop-the-world GC " \
558 "(also see FullGCHeapDumpLimit, HeapDumpPath, HeapDumpGzipLevel)")\
559 \
560 product(bool, HeapDumpAfterFullGC, false, MANAGEABLE, \
561 "Dump heap to file after any major stop-the-world GC " \
562 "(also see FullGCHeapDumpLimit, HeapDumpPath, HeapDumpGzipLevel)")\
563 \
564 product(uint, FullGCHeapDumpLimit, 0, MANAGEABLE, \
565 "Limit the number of heap dumps triggered by " \
566 "HeapDumpBeforeFullGC or HeapDumpAfterFullGC " \
567 "(0 means no limit)") \
568 \
569 product(bool, HeapDumpOnOutOfMemoryError, false, MANAGEABLE, \
570 "Dump heap to file when java.lang.OutOfMemoryError is thrown " \
571 "from JVM " \
572 "(also see HeapDumpPath, HeapDumpGzipLevel)") \
573 \
574 product(ccstr, HeapDumpPath, nullptr, MANAGEABLE, \
575 "When HeapDumpOnOutOfMemoryError, HeapDumpBeforeFullGC " \
576 "or HeapDumpAfterFullGC is on, the path (filename or " \
577 "directory) of the dump file (defaults to java_pid<pid>.hprof " \
578 "in the working directory)") \
579 \
580 product(int, HeapDumpGzipLevel, 0, MANAGEABLE, \
581 "When HeapDumpOnOutOfMemoryError, HeapDumpBeforeFullGC " \
582 "or HeapDumpAfterFullGC is on, the gzip compression " \
583 "level of the dump file. 0 (the default) disables gzip " \
584 "compression. Otherwise the level must be between 1 and 9.") \
585 range(0, 9) \
586 \
587 product(ccstr, NativeMemoryTracking, DEBUG_ONLY("summary") NOT_DEBUG("off"), \
588 "Native memory tracking options") \
589 \
590 product(bool, PrintNMTStatistics, false, DIAGNOSTIC, \
591 "Print native memory tracking summary data if it is on") \
592 \
593 product(bool, LogCompilation, false, DIAGNOSTIC, \
594 "Log compilation activity in detail to LogFile") \
595 \
596 product(bool, PrintCompilation, false, \
597 "Print compilations") \
598 \
599 product(intx, RepeatCompilation, 0, DIAGNOSTIC, \
600 "Repeat compilation without installing code (number of times)") \
601 range(0, max_jint) \
602 \
603 product(bool, PrintExtendedThreadInfo, false, \
604 "Print more information in thread dump") \
605 \
606 product(intx, ScavengeRootsInCode, 2, DIAGNOSTIC, \
607 "0: do not allow scavengable oops in the code cache; " \
608 "1: allow scavenging from the code cache; " \
609 "2: emit as many constants as the compiler can see") \
610 range(0, 2) \
611 \
612 product(bool, AlwaysRestoreFPU, false, \
613 "Restore the FPU control word after every JNI call (expensive)") \
614 \
615 product(bool, PrintCompilation2, false, DIAGNOSTIC, \
616 "Print additional statistics per compilation") \
617 \
618 product(bool, PrintAdapterHandlers, false, DIAGNOSTIC, \
619 "Print code generated for i2c/c2i adapters") \
620 \
621 develop(bool, VerifyAdapterSharing, false, \
622 "Verify that the code for shared adapters is the equivalent") \
623 \
624 product(bool, PrintAssembly, false, DIAGNOSTIC, \
625 "Print assembly code (using external disassembler.so)") \
626 \
627 product(ccstr, PrintAssemblyOptions, nullptr, DIAGNOSTIC, \
628 "Print options string passed to disassembler.so") \
629 \
630 develop(bool, PrintNMethodStatistics, false, \
631 "Print a summary statistic for the generated nmethods") \
632 \
633 product(bool, PrintNMethods, false, DIAGNOSTIC, \
634 "Print assembly code for nmethods when generated") \
635 \
636 product(bool, PrintNativeNMethods, false, DIAGNOSTIC, \
637 "Print assembly code for native nmethods when generated") \
638 \
639 develop(bool, PrintDebugInfo, false, \
640 "Print debug information for all nmethods when generated") \
641 \
642 develop(bool, PrintRelocations, false, \
643 "Print relocation information for all nmethods when generated") \
644 \
645 develop(bool, PrintDependencies, false, \
646 "Print dependency information for all nmethods when generated") \
647 \
648 develop(bool, PrintExceptionHandlers, false, \
649 "Print exception handler tables for all nmethods when generated") \
650 \
651 develop(bool, StressCompiledExceptionHandlers, false, \
652 "Exercise compiled exception handlers") \
653 \
654 product(bool, DeoptimizeOnAllocationException, false, DIAGNOSTIC, \
655 "Deoptimize on exception during allocation instead of using the " \
656 "compiled exception handlers") \
657 \
658 develop(bool, InterceptOSException, false, \
659 "Start debugger when an implicit OS (e.g. null pointer) " \
660 "exception happens") \
661 \
662 product(bool, PrintCodeCache, false, \
663 "Print the code cache memory usage when exiting") \
664 \
665 develop(bool, PrintCodeCache2, false, \
666 "Print detailed usage information on the code cache when exiting")\
667 \
668 product(bool, PrintCodeCacheOnCompilation, false, \
669 "Print the code cache memory usage each time a method is " \
670 "compiled") \
671 \
672 product(bool, PrintCodeHeapAnalytics, false, DIAGNOSTIC, \
673 "Print code heap usage statistics on exit and on full condition") \
674 \
675 product(bool, PrintStubCode, false, DIAGNOSTIC, \
676 "Print generated stub code") \
677 \
678 product(bool, StackTraceInThrowable, true, \
679 "Collect backtrace in throwable when exception happens") \
680 \
681 product(bool, OmitStackTraceInFastThrow, true, \
682 "Omit backtraces for some 'hot' exceptions in optimized code") \
683 \
684 product(bool, ShowCodeDetailsInExceptionMessages, true, MANAGEABLE, \
685 "Show exception messages from RuntimeExceptions that contain " \
686 "snippets of the failing code. Disable this to improve privacy.") \
687 \
688 product(bool, PrintWarnings, true, \
689 "Print JVM warnings to output stream") \
690 \
691 develop(bool, RegisterReferences, true, \
692 "Tell whether the VM should register soft/weak/final/phantom " \
693 "references") \
694 \
695 develop(bool, PrintCodeCacheExtension, false, \
696 "Print extension of code cache") \
697 \
698 product(bool, ClassUnloading, true, \
699 "Do unloading of classes") \
700 \
701 product(bool, ClassUnloadingWithConcurrentMark, true, \
702 "Do unloading of classes with a concurrent marking cycle") \
703 \
704 develop(bool, PrintSystemDictionaryAtExit, false, \
705 "Print the system dictionary at exit") \
706 \
707 develop(bool, PrintClassLoaderDataGraphAtExit, false, \
708 "Print the class loader data graph at exit") \
709 \
710 product(bool, PrintVMInfoAtExit, false, DIAGNOSTIC, \
711 "Executes the VM.info diagnostic command at exit") \
712 \
713 product(bool, AllowParallelDefineClass, false, \
714 "Allow parallel defineClass requests for class loaders " \
715 "registering as parallel capable") \
716 \
717 product(bool, DisablePrimordialThreadGuardPages, false, EXPERIMENTAL, \
718 "Disable the use of stack guard pages if the JVM is loaded " \
719 "on the primordial process thread") \
720 \
721 product(bool, DoJVMTIVirtualThreadTransitions, true, EXPERIMENTAL, \
722 "Do JVMTI virtual thread mount/unmount transitions " \
723 "(disabling this flag implies no JVMTI events are posted)") \
724 \
725 /* notice: the max range value here is max_jint, not max_intx */ \
726 /* because of overflow issue */ \
727 product(intx, AsyncDeflationInterval, 250, DIAGNOSTIC, \
728 "Async deflate idle monitors every so many milliseconds when " \
729 "MonitorUsedDeflationThreshold is exceeded (0 is off).") \
730 range(0, max_jint) \
731 \
732 /* notice: the max range value here is max_jint, not max_intx */ \
733 /* because of overflow issue */ \
734 product(intx, GuaranteedAsyncDeflationInterval, 60000, DIAGNOSTIC, \
735 "Async deflate idle monitors every so many milliseconds even " \
736 "when MonitorUsedDeflationThreshold is NOT exceeded (0 is off).") \
737 range(0, max_jint) \
738 \
739 product(size_t, AvgMonitorsPerThreadEstimate, 1024, DIAGNOSTIC, \
740 "Used to estimate a variable ceiling based on number of threads " \
741 "for use with MonitorUsedDeflationThreshold (0 is off).") \
742 range(0, max_uintx) \
743 \
744 /* notice: the max range value here is max_jint, not max_intx */ \
745 /* because of overflow issue */ \
746 product(intx, MonitorDeflationMax, 1000000, DIAGNOSTIC, \
747 "The maximum number of monitors to deflate, unlink and delete " \
748 "at one time (minimum is 1024).") \
749 range(1024, max_jint) \
750 \
751 product(intx, MonitorUnlinkBatch, 500, DIAGNOSTIC, \
752 "The maximum number of monitors to unlink in one batch. ") \
753 range(1, max_jint) \
754 \
755 product(int, MonitorUsedDeflationThreshold, 90, DIAGNOSTIC, \
756 "Percentage of used monitors before triggering deflation (0 is " \
757 "off). The check is performed on AsyncDeflationInterval or " \
758 "GuaranteedAsyncDeflationInterval, whichever is lower.") \
759 range(0, 100) \
760 \
761 product(uintx, NoAsyncDeflationProgressMax, 3, DIAGNOSTIC, \
762 "Max number of no progress async deflation attempts to tolerate " \
763 "before adjusting the in_use_list_ceiling up (0 is off).") \
764 range(0, max_uintx) \
765 \
766 product(intx, hashCode, 5, EXPERIMENTAL, \
767 "(Unstable) select hashCode generation algorithm") \
768 \
769 product(bool, ReduceSignalUsage, false, \
770 "Reduce the use of OS signals in Java and/or the VM") \
771 \
772 develop(bool, LoadLineNumberTables, true, \
773 "Tell whether the class file parser loads line number tables") \
774 \
775 develop(bool, LoadLocalVariableTables, true, \
776 "Tell whether the class file parser loads local variable tables") \
777 \
778 develop(bool, LoadLocalVariableTypeTables, true, \
779 "Tell whether the class file parser loads local variable type" \
780 "tables") \
781 \
782 product(bool, AllowUserSignalHandlers, false, \
783 "Application will install primary signal handlers for the JVM " \
784 "(Unix only)") \
785 \
786 product(bool, UseSignalChaining, true, \
787 "Use signal-chaining to invoke signal handlers installed " \
788 "by the application (Unix only)") \
789 \
790 product(bool, RestoreMXCSROnJNICalls, false, \
791 "Restore MXCSR when returning from JNI calls") \
792 \
793 product(bool, CheckJNICalls, false, \
794 "Verify all arguments to JNI calls") \
795 \
796 product(bool, UseFastJNIAccessors, true, \
797 "Use optimized versions of Get<Primitive>Field") \
798 \
799 product(intx, MaxJNILocalCapacity, 65536, \
800 "Maximum allowable local JNI handle capacity to " \
801 "EnsureLocalCapacity() and PushLocalFrame(), " \
802 "where <= 0 is unlimited, default: 65536") \
803 range(min_intx, max_intx) \
804 \
805 product(bool, EagerXrunInit, false, \
806 "Eagerly initialize -Xrun libraries; allows startup profiling, " \
807 "but not all -Xrun libraries may support the state of the VM " \
808 "at this time") \
809 \
810 develop(uintx, PreallocatedOutOfMemoryErrorCount, 4, \
811 "Number of OutOfMemoryErrors preallocated with backtrace") \
812 \
813 product(bool, UseXMMForArrayCopy, false, \
814 "Use SSE2 MOVQ instruction for Arraycopy") \
815 \
816 product(bool, PrintFieldLayout, false, DIAGNOSTIC, \
817 "Print field layout for each class") \
818 \
819 product(bool, PrintInlineLayout, false, DIAGNOSTIC, \
820 "Print field layout for each inline type or class with inline fields") \
821 \
822 product(bool, PrintFlatArrayLayout, false, DIAGNOSTIC, \
823 "Print array layout for each inline type array") \
824 \
825 product(bool, UseArrayFlattening, true, \
826 "Allow the VM to flatten arrays") \
827 \
828 product(bool, UseFieldFlattening, true, \
829 "Allow the VM to flatten value fields") \
830 \
831 product(bool, UseNonAtomicValueFlattening, true, \
832 "Allow the JVM to flatten some non-atomic null-free values") \
833 \
834 product(bool, UseNullableValueFlattening, true, \
835 "Allow the JVM to flatten some nullable values") \
836 \
837 product(bool, UseAtomicValueFlattening, true, \
838 "Allow the JVM to flatten some atomic values") \
839 \
840 product(intx, FlatArrayElementMaxOops, 4, \
841 "Max nof embedded object references in an inline type to flatten, <0 no limit") \
842 \
843 develop(ccstrlist, PrintInlineKlassFields, "", \
844 "Print fields collected by InlineKlass::collect_fields") \
845 \
846 /* Need to limit the extent of the padding to reasonable size. */\
847 /* 8K is well beyond the reasonable HW cache line size, even with */\
848 /* aggressive prefetching, while still leaving the room for segregating */\
849 /* among the distinct pages. */\
850 product(int, ContendedPaddingWidth, 128, \
851 "How many bytes to pad the fields/classes marked @Contended with")\
852 range(0, 8192) \
853 constraint(ContendedPaddingWidthConstraintFunc,AfterErgo) \
854 \
855 product(bool, EnableContended, true, \
856 "Enable @Contended annotation support") \
857 \
858 product(bool, RestrictContended, true, \
859 "Restrict @Contended to trusted classes") \
860 \
861 product(int, DiagnoseSyncOnValueBasedClasses, 0, DIAGNOSTIC, \
862 "Detect and take action upon identifying synchronization on " \
863 "value based classes. Modes: " \
864 "0: off; " \
865 "1: exit with fatal error; " \
866 "2: log message to stdout. Output file can be specified with " \
867 " -Xlog:valuebasedclasses. If JFR is running it will " \
868 " also generate JFR events.") \
869 range(0, 2) \
870 \
871 product(bool, ExitOnOutOfMemoryError, false, \
872 "JVM exits on the first occurrence of an out-of-memory error " \
873 "thrown from JVM") \
874 \
875 product(bool, CrashOnOutOfMemoryError, false, \
876 "JVM aborts, producing an error log and core/mini dump, on the " \
877 "first occurrence of an out-of-memory error thrown from JVM") \
878 \
879 product(intx, UserThreadWaitAttemptsAtExit, 30, \
880 "The number of times to wait for user threads to stop executing " \
881 "native code during JVM exit. Each wait lasts 10 milliseconds. " \
882 "The maximum number of waits is 1000, to wait at most 10 " \
883 "seconds.") \
884 range(0, 1000) \
885 \
886 /* tracing */ \
887 \
888 develop(bool, StressRewriter, false, \
889 "Stress linktime bytecode rewriting") \
890 \
891 product(ccstr, TraceJVMTI, nullptr, \
892 "Trace flags for JVMTI functions and events") \
893 \
894 product(bool, StressLdcRewrite, false, DIAGNOSTIC, \
895 "Force ldc -> ldc_w rewrite during RedefineClasses. " \
896 "This option can change an EMCP method into an obsolete method " \
897 "and can affect tests that expect specific methods to be EMCP. " \
898 "This option should be used with caution.") \
899 \
900 product(bool, AllowRedefinitionToAddDeleteMethods, false, \
901 "(Deprecated) Allow redefinition to add and delete private " \
902 "static or final methods for compatibility with old releases") \
903 \
904 develop(bool, TraceBytecodes, false, \
905 "Trace bytecode execution") \
906 \
907 develop(bool, TraceBytecodesTruncated, false, \
908 "Truncate non control-flow bytecode when tracing bytecode") \
909 \
910 develop(bool, VerifyDependencies, trueInDebug, \
911 "Exercise and verify the compilation dependency mechanism") \
912 \
913 develop(bool, TraceNewOopMapGeneration, false, \
914 "Trace OopMapGeneration") \
915 \
916 develop(bool, TraceNewOopMapGenerationDetailed, false, \
917 "Trace OopMapGeneration: print detailed cell states") \
918 \
919 develop(bool, TimeOopMap, false, \
920 "Time calls to GenerateOopMap::compute_map() in sum") \
921 \
922 develop(bool, TimeOopMap2, false, \
923 "Time calls to GenerateOopMap::compute_map() individually") \
924 \
925 develop(bool, TraceOopMapRewrites, false, \
926 "Trace rewriting of methods during oop map generation") \
927 \
928 develop(bool, TraceFinalizerRegistration, false, \
929 "Trace registration of final references") \
930 \
931 product(bool, IgnoreEmptyClassPaths, false, \
932 "Ignore empty path elements in -classpath") \
933 \
934 product(bool, PrintHeapAtSIGBREAK, true, \
935 "Print heap layout in response to SIGBREAK") \
936 \
937 product(bool, PrintClassHistogram, false, MANAGEABLE, \
938 "Print a histogram of class instances") \
939 \
940 product(double, ObjectCountCutOffPercent, 0.5, EXPERIMENTAL, \
941 "The percentage of the used heap that the instances of a class " \
942 "must occupy for the class to generate a trace event") \
943 range(0.0, 100.0) \
944 \
945 /* JVMTI heap profiling */ \
946 \
947 product(bool, VerifyBeforeIteration, false, DIAGNOSTIC, \
948 "Verify memory system before JVMTI iteration") \
949 \
950 /* compiler */ \
951 \
952 /* notice: the max range value here is max_jint, not max_intx */ \
953 /* because of overflow issue */ \
954 product(intx, CICompilerCount, CI_COMPILER_COUNT, \
955 "Number of compiler threads to run") \
956 range(0, max_jint) \
957 constraint(CICompilerCountConstraintFunc, AfterErgo) \
958 \
959 product(bool, UseDynamicNumberOfCompilerThreads, true, \
960 "Dynamically choose the number of parallel compiler threads") \
961 \
962 product(bool, ReduceNumberOfCompilerThreads, true, DIAGNOSTIC, \
963 "Reduce the number of parallel compiler threads when they " \
964 "are not used") \
965 \
966 product(bool, TraceCompilerThreads, false, DIAGNOSTIC, \
967 "Trace creation and removal of compiler threads") \
968 \
969 product(ccstr, LogClassLoadingCauseFor, nullptr, \
970 "Apply -Xlog:class+load+cause* to classes whose fully " \
971 "qualified name contains this string (\"*\" matches " \
972 "any class).") \
973 \
974 develop(bool, InjectCompilerCreationFailure, false, \
975 "Inject thread creation failures for " \
976 "UseDynamicNumberOfCompilerThreads") \
977 \
978 product_pd(bool, ImplicitNullChecks, DIAGNOSTIC, \
979 "Generate code for implicit null checks") \
980 \
981 product_pd(bool, TrapBasedNullChecks, \
982 "Generate code for null checks that uses a cmp and trap " \
983 "instruction raising SIGTRAP. This is only used if an access to" \
984 "null (+offset) will not raise a SIGSEGV, i.e.," \
985 "ImplicitNullChecks don't work (PPC64).") \
986 \
987 product(bool, EnableThreadSMRStatistics, trueInDebug, DIAGNOSTIC, \
988 "Enable Thread SMR Statistics") \
989 \
990 product(bool, Inline, true, \
991 "Enable inlining") \
992 \
993 product(bool, ClipInlining, true, \
994 "Clip inlining if aggregate method exceeds DesiredMethodLimit") \
995 \
996 develop(bool, UseCHA, true, \
997 "Enable CHA") \
998 \
999 product(bool, UseTypeProfile, true, \
1000 "Check interpreter profile for historically monomorphic calls") \
1001 \
1002 product(bool, PrintInlining, false, DIAGNOSTIC, \
1003 "Print inlining optimizations") \
1004 \
1005 product(bool, UsePopCountInstruction, false, \
1006 "Use population count instruction") \
1007 \
1008 develop(bool, TraceMethodReplacement, false, \
1009 "Print when methods are replaced do to recompilation") \
1010 \
1011 product(intx, MinPassesBeforeFlush, 10, DIAGNOSTIC, \
1012 "Minimum number of sweeper passes before an nmethod " \
1013 "can be flushed") \
1014 range(0, max_intx) \
1015 \
1016 develop(bool, StressCodeBuffers, false, \
1017 "Exercise code buffer expansion and other rare state changes") \
1018 \
1019 product(bool, DebugNonSafepoints, trueInDebug, DIAGNOSTIC, \
1020 "Generate extra debugging information for non-safepoints in " \
1021 "nmethods") \
1022 \
1023 product(bool, PrintVMOptions, false, \
1024 "Print flags that appeared on the command line") \
1025 \
1026 product(bool, IgnoreUnrecognizedVMOptions, false, \
1027 "Ignore unrecognized VM options") \
1028 \
1029 product(bool, PrintCommandLineFlags, false, \
1030 "Print flags specified on command line or set by ergonomics") \
1031 \
1032 product(bool, PrintFlagsInitial, false, \
1033 "Print all VM flags before argument processing and exit VM") \
1034 \
1035 product(bool, PrintFlagsFinal, false, \
1036 "Print all VM flags after argument and ergonomic processing") \
1037 \
1038 develop(bool, PrintFlagsWithComments, false, \
1039 "Print all VM flags with default values and descriptions and " \
1040 "exit") \
1041 \
1042 product(bool, PrintFlagsRanges, false, \
1043 "Print VM flags and their ranges") \
1044 \
1045 product(bool, SerializeVMOutput, true, DIAGNOSTIC, \
1046 "Use a mutex to serialize output to tty and LogFile") \
1047 \
1048 product(bool, DisplayVMOutput, true, DIAGNOSTIC, \
1049 "Display all VM output on the tty, independently of LogVMOutput") \
1050 \
1051 product(bool, LogVMOutput, false, DIAGNOSTIC, \
1052 "Save VM output to LogFile") \
1053 \
1054 product(ccstr, LogFile, nullptr, DIAGNOSTIC, \
1055 "If LogVMOutput or LogCompilation is on, save VM output to " \
1056 "this file [default: ./hotspot_pid%p.log] (%p replaced with pid)")\
1057 \
1058 product(ccstr, ErrorFile, nullptr, \
1059 "If an error occurs, save the error data to this file " \
1060 "[default: ./hs_err_pid%p.log] (%p replaced with pid)") \
1061 \
1062 product(bool, ExtensiveErrorReports, \
1063 PRODUCT_ONLY(false) NOT_PRODUCT(true), \
1064 "Error reports are more extensive.") \
1065 \
1066 product(bool, DisplayVMOutputToStderr, false, \
1067 "If DisplayVMOutput is true, display all VM output to stderr") \
1068 \
1069 product(bool, DisplayVMOutputToStdout, false, \
1070 "If DisplayVMOutput is true, display all VM output to stdout") \
1071 \
1072 product(bool, ErrorFileToStderr, false, \
1073 "If true, error data is printed to stderr instead of a file") \
1074 \
1075 product(bool, ErrorFileToStdout, false, \
1076 "If true, error data is printed to stdout instead of a file") \
1077 \
1078 product(bool, PrintStringTableStatistics, false, \
1079 "print statistics about the StringTable and SymbolTable") \
1080 \
1081 product(bool, VerifyStringTableAtExit, false, DIAGNOSTIC, \
1082 "verify StringTable contents at exit") \
1083 \
1084 develop(bool, PrintSymbolTableSizeHistogram, false, \
1085 "print histogram of the symbol table") \
1086 \
1087 product(ccstr, AbortVMOnException, nullptr, DIAGNOSTIC, \
1088 "Call fatal if this exception is thrown. Example: " \
1089 "java -XX:AbortVMOnException=java.lang.NullPointerException Foo") \
1090 \
1091 product(ccstr, AbortVMOnExceptionMessage, nullptr, DIAGNOSTIC, \
1092 "Call fatal if the exception pointed by AbortVMOnException " \
1093 "has this message") \
1094 \
1095 develop(bool, DebugVtables, false, \
1096 "add debugging code to vtable dispatch") \
1097 \
1098 product(bool, RangeCheckElimination, true, \
1099 "Eliminate range checks") \
1100 \
1101 develop_pd(bool, UncommonNullCast, \
1102 "track occurrences of null in casts; adjust compiler tactics") \
1103 \
1104 develop(bool, TypeProfileCasts, true, \
1105 "treat casts like calls for purposes of type profiling") \
1106 \
1107 develop(bool, TraceLivenessGen, false, \
1108 "Trace the generation of liveness analysis information") \
1109 \
1110 develop(bool, TraceLivenessQuery, false, \
1111 "Trace queries of liveness analysis information") \
1112 \
1113 develop(bool, CollectIndexSetStatistics, false, \
1114 "Collect information about IndexSets") \
1115 \
1116 /* This value is later shifted left by up to LogBytesPerLong bits */\
1117 /* (to convert from element count to size in bytes), so we must ensure */\
1118 /* it does not overflow during the shift. */\
1119 develop(int, FastAllocateSizeLimit, 128*K, \
1120 /* Note: This value is zero mod 1<<13 for a cheap sparc set. */ \
1121 "Inline allocations larger than this in doublewords must go slow")\
1122 range(0, (1 << (BitsPerInt - LogBytesPerLong - 1)) - 1) \
1123 \
1124 product_pd(bool, CompactStrings, \
1125 "Enable Strings to use single byte chars in backing store") \
1126 \
1127 product_pd(uint, TypeProfileLevel, \
1128 "=XYZ, with Z: Type profiling of arguments at call; " \
1129 "Y: Type profiling of return value at call; " \
1130 "X: Type profiling of parameters to methods; " \
1131 "X, Y and Z in 0=off ; 1=jsr292 only; 2=all methods") \
1132 constraint(TypeProfileLevelConstraintFunc, AfterErgo) \
1133 \
1134 product(int, TypeProfileArgsLimit, 2, \
1135 "max number of call arguments to consider for type profiling") \
1136 range(0, 16) \
1137 \
1138 product(int, TypeProfileParmsLimit, 2, \
1139 "max number of incoming parameters to consider for type profiling"\
1140 ", -1 for all") \
1141 range(-1, 64) \
1142 \
1143 /* statistics */ \
1144 develop(bool, CountCompiledCalls, false, \
1145 "Count method invocations") \
1146 \
1147 develop(bool, ICMissHistogram, false, \
1148 "Produce histogram of IC misses") \
1149 \
1150 /* interpreter */ \
1151 product_pd(bool, RewriteBytecodes, \
1152 "Allow rewriting of bytecodes (bytecodes are not immutable)") \
1153 \
1154 product_pd(bool, RewriteFrequentPairs, \
1155 "Rewrite frequently used bytecode pairs into a single bytecode") \
1156 \
1157 product(bool, PrintInterpreter, false, DIAGNOSTIC, \
1158 "Print the generated interpreter code") \
1159 \
1160 product(bool, UseInterpreter, true, \
1161 "Use interpreter for non-compiled methods") \
1162 \
1163 develop(bool, UseFastSignatureHandlers, true, \
1164 "Use fast signature handlers for native calls") \
1165 \
1166 product(bool, UseLoopCounter, true, \
1167 "Increment invocation counter on backward branch") \
1168 \
1169 product_pd(bool, UseOnStackReplacement, \
1170 "Use on stack replacement, calls runtime if invoc. counter " \
1171 "overflows in loop") \
1172 \
1173 develop(bool, TraceOnStackReplacement, false, \
1174 "Trace on stack replacement") \
1175 \
1176 product_pd(bool, PreferInterpreterNativeStubs, \
1177 "Use always interpreter stubs for native methods invoked via " \
1178 "interpreter") \
1179 \
1180 develop(bool, CountBytecodes, false, \
1181 "Count number of bytecodes executed") \
1182 \
1183 develop(bool, PrintBytecodeHistogram, false, \
1184 "Print histogram of the executed bytecodes") \
1185 \
1186 develop(bool, PrintBytecodePairHistogram, false, \
1187 "Print histogram of the executed bytecode pairs") \
1188 \
1189 product(bool, PrintSignatureHandlers, false, DIAGNOSTIC, \
1190 "Print code generated for native method signature handlers") \
1191 \
1192 develop(bool, VerifyOops, false, \
1193 "Do plausibility checks for oops") \
1194 \
1195 develop(bool, CheckUnhandledOops, false, \
1196 "Check for unhandled oops in VM code") \
1197 \
1198 develop(bool, VerifyJNIFields, trueInDebug, \
1199 "Verify jfieldIDs for instance fields") \
1200 \
1201 develop(bool, VerifyActivationFrameSize, false, \
1202 "Verify that activation frame didn't become smaller than its " \
1203 "minimal size") \
1204 \
1205 develop(bool, TraceFrequencyInlining, false, \
1206 "Trace frequency based inlining") \
1207 \
1208 develop_pd(bool, InlineIntrinsics, \
1209 "Use intrinsics in Interpreter that can be statically resolved") \
1210 \
1211 product_pd(bool, ProfileInterpreter, \
1212 "Profile at the bytecode level during interpretation") \
1213 \
1214 develop_pd(bool, ProfileTraps, \
1215 "Profile deoptimization traps at the bytecode level") \
1216 \
1217 product(intx, ProfileMaturityPercentage, 20, \
1218 "number of method invocations/branches (expressed as % of " \
1219 "CompileThreshold) before using the method's profile") \
1220 range(0, 100) \
1221 \
1222 product(bool, PrintMethodData, false, DIAGNOSTIC, \
1223 "Print the results of +ProfileInterpreter at end of run") \
1224 \
1225 develop(bool, VerifyDataPointer, trueInDebug, \
1226 "Verify the method data pointer during interpreter profiling") \
1227 \
1228 develop(bool, CrashGCForDumpingJavaThread, false, \
1229 "Manually make GC thread crash then dump java stack trace; " \
1230 "Test only") \
1231 \
1232 /* compilation */ \
1233 product(bool, UseCompiler, true, \
1234 "Use Just-In-Time compilation") \
1235 \
1236 product(bool, AlwaysCompileLoopMethods, false, \
1237 "When using recompilation, never interpret methods " \
1238 "containing loops") \
1239 \
1240 product(int, AllocatePrefetchStyle, 1, \
1241 "0 = no prefetch, " \
1242 "1 = generate prefetch instructions for each allocation, " \
1243 "2 = use TLAB watermark to gate allocation prefetch, " \
1244 "3 = generate one prefetch instruction per cache line") \
1245 range(0, 3) \
1246 \
1247 product(int, AllocatePrefetchDistance, -1, \
1248 "Distance to prefetch ahead of allocation pointer. " \
1249 "-1: use system-specific value (automatically determined") \
1250 range(-1, 512) \
1251 \
1252 product(int, AllocatePrefetchLines, 3, \
1253 "Number of lines to prefetch ahead of array allocation pointer") \
1254 range(1, 64) \
1255 \
1256 product(int, AllocateInstancePrefetchLines, 1, \
1257 "Number of lines to prefetch ahead of instance allocation " \
1258 "pointer") \
1259 range(1, 64) \
1260 \
1261 product(int, AllocatePrefetchStepSize, 16, \
1262 "Step size in bytes of sequential prefetch instructions") \
1263 range(1, 512) \
1264 constraint(AllocatePrefetchStepSizeConstraintFunc,AfterMemoryInit)\
1265 \
1266 product(intx, AllocatePrefetchInstr, 0, \
1267 "Select instruction to prefetch ahead of allocation pointer") \
1268 constraint(AllocatePrefetchInstrConstraintFunc, AfterMemoryInit) \
1269 \
1270 /* deoptimization */ \
1271 product(bool, TraceDeoptimization, false, DIAGNOSTIC, \
1272 "Trace deoptimization") \
1273 \
1274 develop(bool, PrintDeoptimizationDetails, false, \
1275 "Print more information about deoptimization") \
1276 \
1277 develop(bool, DebugDeoptimization, false, \
1278 "Tracing various information while debugging deoptimization") \
1279 \
1280 product(double, SelfDestructTimer, 0.0, \
1281 "Will cause VM to terminate after a given time " \
1282 "(in fractional minutes) " \
1283 "(0.0 means off)") \
1284 range(0.0, (double)max_intx) \
1285 \
1286 product(int, MaxJavaStackTraceDepth, 1024, \
1287 "The maximum number of lines in the stack trace for Java " \
1288 "exceptions (0 means all)") \
1289 range(0, max_jint/2) \
1290 \
1291 /* notice: the max range value here is max_jint, not max_intx */ \
1292 /* because of overflow issue */ \
1293 product(intx, GuaranteedSafepointInterval, 0, DIAGNOSTIC, \
1294 "Guarantee a safepoint (at least) every so many milliseconds " \
1295 "(0 means none)") \
1296 range(0, max_jint) \
1297 \
1298 product(intx, ServiceThreadCleanupInterval, 1000, DIAGNOSTIC, \
1299 "Wake the ServiceThread to do periodic cleanup checks every so " \
1300 "many milliseconds (0 means none)") \
1301 range(0, max_jint) \
1302 \
1303 product(double, SafepointTimeoutDelay, 10000, \
1304 "Delay in milliseconds for option SafepointTimeout; " \
1305 "supports sub-millisecond resolution with fractional values.") \
1306 range(0, max_jlongDouble LP64_ONLY(/MICROUNITS)) \
1307 \
1308 product(bool, UseSystemMemoryBarrier, false, \
1309 "Try to enable system memory barrier if supported by OS") \
1310 \
1311 product(intx, NmethodSweepActivity, 4, \
1312 "Removes cold nmethods from code cache if > 0. Higher values " \
1313 "result in more aggressive sweeping") \
1314 range(0, 2000) \
1315 \
1316 develop(intx, MallocCatchPtr, -1, \
1317 "Hit breakpoint when mallocing/freeing this pointer") \
1318 \
1319 develop(int, StackPrintLimit, 100, \
1320 "number of stack frames to print in VM-level stack dump") \
1321 \
1322 product(int, ErrorLogPrintCodeLimit, 3, DIAGNOSTIC, \
1323 "max number of compiled code units to print in error log") \
1324 range(0, VMError::max_error_log_print_code) \
1325 \
1326 develop(int, MaxElementPrintSize, 256, \
1327 "maximum number of elements to print") \
1328 \
1329 develop(int, MaxStringPrintSize, 256, \
1330 "maximum number of characters to print for a java.lang.String " \
1331 "in the VM. If exceeded, an abridged version of the string is " \
1332 "printed with the middle of the string elided.") \
1333 range(2, O_BUFLEN) \
1334 \
1335 develop(intx, MaxSubklassPrintSize, 4, \
1336 "maximum number of subklasses to print when printing klass") \
1337 \
1338 develop(intx, MaxForceInlineLevel, 100, \
1339 "maximum number of nested calls that are forced for inlining " \
1340 "(using CompileCommand or marked w/ @ForceInline)") \
1341 range(0, max_jint) \
1342 \
1343 develop(intx, MethodHistogramCutoff, 100, \
1344 "The cutoff value for method invocation histogram (+CountCalls)") \
1345 \
1346 develop(intx, DeoptimizeALotInterval, 5, \
1347 "Number of exits until DeoptimizeALot kicks in") \
1348 \
1349 develop(intx, ZombieALotInterval, 5, \
1350 "Number of exits until ZombieALot kicks in") \
1351 \
1352 product(ccstr, MallocLimit, nullptr, DIAGNOSTIC, \
1353 "Limit malloc allocation size from VM. Reaching a limit will " \
1354 "trigger an action (see flag). This feature requires " \
1355 "NativeMemoryTracking=summary or NativeMemoryTracking=detail." \
1356 "Usage:" \
1357 "\"-XX:MallocLimit=<size>[:<flag>]\" sets a total limit." \
1358 "\"-XX:MallocLimit=<category>:<size>[:<flag>][,<category>:<size>[:<flag>] ...]\"" \
1359 "sets one or more category-specific limits." \
1360 "<flag> defines the action upon reaching the limit:" \
1361 "\"fatal\": end VM with a fatal error at the allocation site" \
1362 "\"oom\" : will mimic a native OOM" \
1363 "If <flag> is omitted, \"fatal\" is the default." \
1364 "Examples:\n" \
1365 "-XX:MallocLimit=2g" \
1366 "-XX:MallocLimit=2g:oom" \
1367 "-XX:MallocLimit=compiler:200m:oom,code:100m") \
1368 \
1369 product(intx, TypeProfileWidth, 2, \
1370 "Number of receiver types to record in call/cast profile") \
1371 range(0, 8) \
1372 \
1373 develop(intx, BciProfileWidth, 2, \
1374 "Number of return bci's to record in ret profile") \
1375 \
1376 product(intx, PerMethodRecompilationCutoff, 400, \
1377 "After recompiling N times, stay in the interpreter (-1=>'Inf')") \
1378 range(-1, max_intx) \
1379 \
1380 product(intx, PerBytecodeRecompilationCutoff, 200, \
1381 "Per-BCI limit on repeated recompilation (-1=>'Inf')") \
1382 range(-1, max_intx) \
1383 \
1384 product(intx, PerMethodTrapLimit, 100, \
1385 "Limit on traps (of one kind) in a method (includes inlines)") \
1386 range(0, max_jint) \
1387 \
1388 product(intx, PerMethodSpecTrapLimit, 5000, EXPERIMENTAL, \
1389 "Limit on speculative traps (of one kind) in a method " \
1390 "(includes inlines)") \
1391 range(0, max_jint) \
1392 \
1393 product(intx, PerBytecodeTrapLimit, 4, \
1394 "Limit on traps (of one kind) at a particular BCI") \
1395 range(0, max_jint) \
1396 \
1397 product(int, SpecTrapLimitExtraEntries, 3, EXPERIMENTAL, \
1398 "Extra method data trap entries for speculation") \
1399 \
1400 product(double, InlineFrequencyRatio, 0.25, DIAGNOSTIC, \
1401 "Ratio of call site execution to caller method invocation") \
1402 \
1403 product(double, MinInlineFrequencyRatio, 0.0085, DIAGNOSTIC, \
1404 "Minimum ratio of call site execution to caller method" \
1405 "invocation to be considered for inlining") \
1406 \
1407 develop(intx, InlineThrowCount, 50, \
1408 "Force inlining of interpreted methods that throw this often") \
1409 range(0, max_jint) \
1410 \
1411 develop(intx, InlineThrowMaxSize, 200, \
1412 "Force inlining of throwing methods smaller than this") \
1413 range(0, max_jint) \
1414 \
1415 product(size_t, MetaspaceSize, NOT_LP64(16 * M) LP64_ONLY(21 * M), \
1416 "Initial threshold (in bytes) at which a garbage collection " \
1417 "is done to reduce Metaspace usage") \
1418 constraint(MetaspaceSizeConstraintFunc,AfterErgo) \
1419 \
1420 product(size_t, MaxMetaspaceSize, max_uintx, \
1421 "Maximum size of Metaspaces (in bytes)") \
1422 constraint(MaxMetaspaceSizeConstraintFunc,AfterErgo) \
1423 \
1424 product(bool, UseCompressedClassPointers, true, \
1425 "(Deprecated) Use 32-bit class pointers.") \
1426 \
1427 product(size_t, CompressedClassSpaceSize, 1*G, \
1428 "Maximum size of class area in Metaspace when compressed " \
1429 "class pointers are used") \
1430 range(1*M, LP64_ONLY(4*G) NOT_LP64(max_uintx)) \
1431 \
1432 develop(size_t, CompressedClassSpaceBaseAddress, 0, \
1433 "Force the class space to be allocated at this address or " \
1434 "fails VM initialization (requires -Xshare=off.") \
1435 \
1436 develop(bool, RandomizeClassSpaceLocation, true, \
1437 "Randomize location of class space.") \
1438 \
1439 product(bool, PrintMetaspaceStatisticsAtExit, false, DIAGNOSTIC, \
1440 "Print metaspace statistics upon VM exit.") \
1441 \
1442 product(bool, PrintCompilerMemoryStatisticsAtExit, false, DIAGNOSTIC, \
1443 "Print compiler memory statistics upon VM exit.") \
1444 \
1445 product(uintx, MinHeapFreeRatio, 40, MANAGEABLE, \
1446 "The minimum percentage of heap free after GC to avoid expansion."\
1447 " For most GCs this applies to the old generation. In G1 and" \
1448 " ParallelGC it applies to the whole heap.") \
1449 range(0, 100) \
1450 constraint(MinHeapFreeRatioConstraintFunc,AfterErgo) \
1451 \
1452 product(uintx, MaxHeapFreeRatio, 70, MANAGEABLE, \
1453 "The maximum percentage of heap free after GC to avoid shrinking."\
1454 " For most GCs this applies to the old generation. In G1 and" \
1455 " ParallelGC it applies to the whole heap.") \
1456 range(0, 100) \
1457 constraint(MaxHeapFreeRatioConstraintFunc,AfterErgo) \
1458 \
1459 product(intx, SoftRefLRUPolicyMSPerMB, 1000, \
1460 "Number of milliseconds per MB of free space in the heap") \
1461 range(0, max_intx) \
1462 constraint(SoftRefLRUPolicyMSPerMBConstraintFunc,AfterMemoryInit) \
1463 \
1464 product(size_t, MinHeapDeltaBytes, ScaleForWordSize(128*K), \
1465 "The minimum change in heap space due to GC (in bytes)") \
1466 range(0, max_uintx / 2 + 1) \
1467 \
1468 product(size_t, MinMetaspaceExpansion, ScaleForWordSize(256*K), \
1469 "The minimum expansion of Metaspace (in bytes)") \
1470 range(0, max_uintx) \
1471 \
1472 product(uint, MaxMetaspaceFreeRatio, 70, \
1473 "The maximum percentage of Metaspace free after GC to avoid " \
1474 "shrinking") \
1475 range(0, 100) \
1476 constraint(MaxMetaspaceFreeRatioConstraintFunc,AfterErgo) \
1477 \
1478 product(uint, MinMetaspaceFreeRatio, 40, \
1479 "The minimum percentage of Metaspace free after GC to avoid " \
1480 "expansion") \
1481 range(0, 99) \
1482 constraint(MinMetaspaceFreeRatioConstraintFunc,AfterErgo) \
1483 \
1484 product(size_t, MaxMetaspaceExpansion, ScaleForWordSize(4*M), \
1485 "The maximum expansion of Metaspace without full GC (in bytes)") \
1486 range(0, max_uintx) \
1487 \
1488 /* stack parameters */ \
1489 product_pd(intx, StackYellowPages, \
1490 "Number of yellow zone (recoverable overflows) pages of size " \
1491 "4KB. If pages are bigger yellow zone is aligned up.") \
1492 range(MIN_STACK_YELLOW_PAGES, (DEFAULT_STACK_YELLOW_PAGES+5)) \
1493 \
1494 product_pd(intx, StackRedPages, \
1495 "Number of red zone (unrecoverable overflows) pages of size " \
1496 "4KB. If pages are bigger red zone is aligned up.") \
1497 range(MIN_STACK_RED_PAGES, (DEFAULT_STACK_RED_PAGES+2)) \
1498 \
1499 product_pd(intx, StackReservedPages, \
1500 "Number of reserved zone (reserved to annotated methods) pages" \
1501 " of size 4KB. If pages are bigger reserved zone is aligned up.") \
1502 range(MIN_STACK_RESERVED_PAGES, (DEFAULT_STACK_RESERVED_PAGES+10))\
1503 \
1504 product(bool, RestrictReservedStack, true, \
1505 "Restrict @ReservedStackAccess to trusted classes") \
1506 \
1507 /* greater stack shadow pages can't generate instruction to bang stack */ \
1508 product_pd(intx, StackShadowPages, \
1509 "Number of shadow zone (for overflow checking) pages of size " \
1510 "4KB. If pages are bigger shadow zone is aligned up. " \
1511 "This should exceed the depth of the VM and native call stack.") \
1512 range(MIN_STACK_SHADOW_PAGES, (DEFAULT_STACK_SHADOW_PAGES+30)) \
1513 \
1514 product_pd(intx, ThreadStackSize, \
1515 "Thread Stack Size (in Kbytes)") \
1516 range(0, 1 * M) \
1517 \
1518 product_pd(intx, VMThreadStackSize, \
1519 "Non-Java Thread Stack Size (in Kbytes)") \
1520 range(0, max_intx/(1 * K)) \
1521 \
1522 product_pd(intx, CompilerThreadStackSize, \
1523 "Compiler Thread Stack Size (in Kbytes)") \
1524 range(0, max_intx/(1 * K)) \
1525 \
1526 develop_pd(size_t, JVMInvokeMethodSlack, \
1527 "Stack space (bytes) required for JVM_InvokeMethod to complete") \
1528 \
1529 /* code cache parameters */ \
1530 product_pd(size_t, CodeCacheSegmentSize, EXPERIMENTAL, \
1531 "Code cache segment size (in bytes) - smallest unit of " \
1532 "allocation") \
1533 range(1, 1024) \
1534 constraint(CodeCacheSegmentSizeConstraintFunc, AfterErgo) \
1535 \
1536 product_pd(intx, CodeEntryAlignment, EXPERIMENTAL, \
1537 "Code entry alignment for generated code (in bytes)") \
1538 constraint(CodeEntryAlignmentConstraintFunc, AfterErgo) \
1539 \
1540 product_pd(intx, OptoLoopAlignment, \
1541 "Align inner loops to zero relative to this modulus") \
1542 range(1, 128) \
1543 constraint(OptoLoopAlignmentConstraintFunc, AfterErgo) \
1544 \
1545 product_pd(size_t, InitialCodeCacheSize, \
1546 "Initial code cache size (in bytes)") \
1547 constraint(VMPageSizeConstraintFunc, AtParse) \
1548 \
1549 develop_pd(size_t, CodeCacheMinimumUseSpace, \
1550 "Minimum code cache size (in bytes) required to start VM.") \
1551 range(0, SIZE_MAX) \
1552 \
1553 product(bool, SegmentedCodeCache, false, \
1554 "Use a segmented code cache") \
1555 \
1556 product_pd(size_t, ReservedCodeCacheSize, \
1557 "Reserved code cache size (in bytes) - maximum code cache size") \
1558 constraint(VMPageSizeConstraintFunc, AtParse) \
1559 \
1560 product_pd(size_t, NonProfiledCodeHeapSize, \
1561 "Size of code heap with non-profiled methods (in bytes)") \
1562 range(0, SIZE_MAX) \
1563 \
1564 product_pd(size_t, ProfiledCodeHeapSize, \
1565 "Size of code heap with profiled methods (in bytes)") \
1566 range(0, SIZE_MAX) \
1567 \
1568 product_pd(size_t, NonNMethodCodeHeapSize, \
1569 "Size of code heap with non-nmethods (in bytes)") \
1570 constraint(VMPageSizeConstraintFunc, AtParse) \
1571 \
1572 product_pd(size_t, CodeCacheExpansionSize, \
1573 "Code cache expansion size (in bytes)") \
1574 range(32*K, SIZE_MAX) \
1575 \
1576 product_pd(size_t, CodeCacheMinBlockLength, DIAGNOSTIC, \
1577 "Minimum number of segments in a code cache block") \
1578 range(1, 100) \
1579 \
1580 develop(bool, ExitOnFullCodeCache, false, \
1581 "Exit the VM if we fill the code cache") \
1582 \
1583 product(bool, UseCodeCacheFlushing, true, \
1584 "Remove cold/old nmethods from the code cache") \
1585 \
1586 product(double, SweeperThreshold, 15.0, \
1587 "Threshold when a code cache unloading GC is invoked." \
1588 "Value is percentage of ReservedCodeCacheSize.") \
1589 range(0.0, 100.0) \
1590 \
1591 product(uintx, StartAggressiveSweepingAt, 10, \
1592 "Start aggressive sweeping if less than X[%] of the total code cache is free.")\
1593 range(0, 100) \
1594 \
1595 product(bool, NMethodRelocation, false, EXPERIMENTAL, \
1596 "Enables use of experimental function nmethod::relocate()") \
1597 \
1598 /* interpreter debugging */ \
1599 develop(intx, BinarySwitchThreshold, 5, \
1600 "Minimal number of lookupswitch entries for rewriting to binary " \
1601 "switch") \
1602 \
1603 develop(uintx, StopInterpreterAt, 0, \
1604 "Stop interpreter execution at specified bytecode number") \
1605 \
1606 develop(uintx, TraceBytecodesAt, 0, \
1607 "Trace bytecodes starting with specified bytecode number") \
1608 \
1609 develop(uintx, TraceBytecodesStopAt, 0, \
1610 "Stop bytecode tracing at the specified bytecode number") \
1611 \
1612 /* Priorities */ \
1613 product_pd(bool, UseThreadPriorities, "Use native thread priorities") \
1614 \
1615 product(int, ThreadPriorityPolicy, 0, \
1616 "0 : Normal. "\
1617 " VM chooses priorities that are appropriate for normal "\
1618 " applications. "\
1619 " On Windows applications are allowed to use higher native "\
1620 " priorities. However, with ThreadPriorityPolicy=0, VM will "\
1621 " not use the highest possible native priority, "\
1622 " THREAD_PRIORITY_TIME_CRITICAL, as it may interfere with "\
1623 " system threads. On Linux thread priorities are ignored "\
1624 " because the OS does not support static priority in "\
1625 " SCHED_OTHER scheduling class which is the only choice for "\
1626 " non-root, non-realtime applications. "\
1627 "1 : Aggressive. "\
1628 " Java thread priorities map over to the entire range of "\
1629 " native thread priorities. Higher Java thread priorities map "\
1630 " to higher native thread priorities. This policy should be "\
1631 " used with care, as sometimes it can cause performance "\
1632 " degradation in the application and/or the entire system. On "\
1633 " Linux/BSD/macOS this policy requires root privilege or an "\
1634 " extended capability.") \
1635 range(0, 1) \
1636 \
1637 product(bool, ThreadPriorityVerbose, false, \
1638 "Print priority changes") \
1639 \
1640 product(int, CompilerThreadPriority, -1, \
1641 "The native priority at which compiler threads should run " \
1642 "(-1 means no change)") \
1643 range(min_jint, max_jint) \
1644 \
1645 product(int, VMThreadPriority, -1, \
1646 "The native priority at which the VM thread should run " \
1647 "(-1 means no change)") \
1648 range(min_jint, max_jint) \
1649 \
1650 product(int, JavaPriority1_To_OSPriority, -1, \
1651 "Map Java priorities to OS priorities") \
1652 range(min_jint, max_jint) \
1653 \
1654 product(int, JavaPriority2_To_OSPriority, -1, \
1655 "Map Java priorities to OS priorities") \
1656 range(min_jint, max_jint) \
1657 \
1658 product(int, JavaPriority3_To_OSPriority, -1, \
1659 "Map Java priorities to OS priorities") \
1660 range(min_jint, max_jint) \
1661 \
1662 product(int, JavaPriority4_To_OSPriority, -1, \
1663 "Map Java priorities to OS priorities") \
1664 range(min_jint, max_jint) \
1665 \
1666 product(int, JavaPriority5_To_OSPriority, -1, \
1667 "Map Java priorities to OS priorities") \
1668 range(min_jint, max_jint) \
1669 \
1670 product(int, JavaPriority6_To_OSPriority, -1, \
1671 "Map Java priorities to OS priorities") \
1672 range(min_jint, max_jint) \
1673 \
1674 product(int, JavaPriority7_To_OSPriority, -1, \
1675 "Map Java priorities to OS priorities") \
1676 range(min_jint, max_jint) \
1677 \
1678 product(int, JavaPriority8_To_OSPriority, -1, \
1679 "Map Java priorities to OS priorities") \
1680 range(min_jint, max_jint) \
1681 \
1682 product(int, JavaPriority9_To_OSPriority, -1, \
1683 "Map Java priorities to OS priorities") \
1684 range(min_jint, max_jint) \
1685 \
1686 product(int, JavaPriority10_To_OSPriority,-1, \
1687 "Map Java priorities to OS priorities") \
1688 range(min_jint, max_jint) \
1689 \
1690 product(bool, UseCriticalJavaThreadPriority, false, EXPERIMENTAL, \
1691 "Java thread priority 10 maps to critical scheduling priority") \
1692 \
1693 product(bool, UseCriticalCompilerThreadPriority, false, EXPERIMENTAL, \
1694 "Compiler thread(s) run at critical scheduling priority") \
1695 \
1696 develop(intx, NewCodeParameter, 0, \
1697 "Testing Only: Create a dedicated integer parameter before " \
1698 "putback") \
1699 \
1700 /* new oopmap storage allocation */ \
1701 develop(intx, MinOopMapAllocation, 8, \
1702 "Minimum number of OopMap entries in an OopMapSet") \
1703 \
1704 /* recompilation */ \
1705 product_pd(intx, CompileThreshold, \
1706 "number of interpreted method invocations before (re-)compiling") \
1707 constraint(CompileThresholdConstraintFunc, AfterErgo) \
1708 \
1709 product_pd(bool, TieredCompilation, \
1710 "Enable tiered compilation") \
1711 \
1712 /* Properties for Java libraries */ \
1713 \
1714 product(uint64_t, MaxDirectMemorySize, 0, \
1715 "Maximum total size of NIO direct-buffer allocations. " \
1716 "Ignored if not explicitly set.") \
1717 range(0, max_jlong) \
1718 \
1719 /* Flags used for temporary code during development */ \
1720 \
1721 product(bool, UseNewCode, false, DIAGNOSTIC, \
1722 "Testing Only: Use the new version while testing") \
1723 \
1724 product(bool, UseNewCode2, false, DIAGNOSTIC, \
1725 "Testing Only: Use the new version while testing") \
1726 \
1727 product(bool, UseNewCode3, false, DIAGNOSTIC, \
1728 "Testing Only: Use the new version while testing") \
1729 \
1730 develop(bool, UseDebuggerErgo, false, \
1731 "Debugging Only: Adjust the VM to be more debugger-friendly. " \
1732 "Turns on the other UseDebuggerErgo* flags") \
1733 \
1734 develop(bool, UseDebuggerErgo1, false, \
1735 "Debugging Only: Enable workarounds for debugger induced " \
1736 "os::processor_id() >= os::processor_count() problems") \
1737 \
1738 develop(bool, UseDebuggerErgo2, false, \
1739 "Debugging Only: Limit the number of spawned JVM threads") \
1740 \
1741 develop(bool, EnableJVMTIStackDepthAsserts, true, \
1742 "Enable JVMTI asserts related to stack depth checks") \
1743 \
1744 /* flags for performance data collection */ \
1745 \
1746 product(bool, UsePerfData, true, \
1747 "Flag to disable jvmstat instrumentation for performance testing "\
1748 "and problem isolation purposes") \
1749 \
1750 product(bool, PerfDataSaveToFile, false, \
1751 "Save PerfData memory to hsperfdata_<pid> file on exit") \
1752 \
1753 product(ccstr, PerfDataSaveFile, nullptr, \
1754 "Save PerfData memory to the specified absolute pathname. " \
1755 "The string %p in the file name (if present) " \
1756 "will be replaced by pid") \
1757 \
1758 product(bool, PerfDisableSharedMem, false, \
1759 "Store performance data in standard memory") \
1760 \
1761 product(int, PerfDataMemorySize, 32*K, \
1762 "Size of performance data memory region. Will be rounded " \
1763 "up to a multiple of the native os page size.") \
1764 range(128, 32*64*K) \
1765 \
1766 product(int, PerfMaxStringConstLength, 1024, \
1767 "Maximum PerfStringConstant string length before truncation") \
1768 range(32, 32*K) \
1769 \
1770 product(bool, PerfAllowAtExitRegistration, false, \
1771 "Allow registration of atexit() methods") \
1772 \
1773 product(bool, PerfBypassFileSystemCheck, false, \
1774 "Bypass Win32 file system criteria checks (Windows Only)") \
1775 \
1776 product(int, UnguardOnExecutionViolation, 0, \
1777 "Unguard page and retry on no-execute fault (Win32 only) " \
1778 "0=off, 1=conservative, 2=aggressive") \
1779 range(0, 2) \
1780 \
1781 /* Serviceability Support */ \
1782 \
1783 product(bool, ManagementServer, false, \
1784 "Create JMX Management Server") \
1785 \
1786 product(bool, DisableAttachMechanism, false, \
1787 "Disable mechanism that allows tools to attach to this VM") \
1788 \
1789 product(bool, StartAttachListener, false, \
1790 "Always start Attach Listener at VM startup") \
1791 \
1792 product(bool, EnableDynamicAgentLoading, true, \
1793 "Allow tools to load agents with the attach mechanism") \
1794 \
1795 product(bool, PrintConcurrentLocks, false, MANAGEABLE, \
1796 "Print java.util.concurrent locks in thread dump") \
1797 \
1798 product(bool, PrintMethodHandleStubs, false, DIAGNOSTIC, \
1799 "Print generated stub code for method handles") \
1800 \
1801 product(bool, VerifyMethodHandles, trueInDebug, DIAGNOSTIC, \
1802 "perform extra checks when constructing method handles") \
1803 \
1804 product(bool, IgnoreAssertUnsetFields, false, DIAGNOSTIC, \
1805 "Ignore assert_unset_fields") \
1806 \
1807 product(bool, ShowHiddenFrames, false, DIAGNOSTIC, \
1808 "show method handle implementation frames (usually hidden)") \
1809 \
1810 product(bool, ShowCarrierFrames, false, DIAGNOSTIC, \
1811 "show virtual threads' carrier frames in exceptions") \
1812 \
1813 product(bool, TrustFinalNonStaticFields, false, EXPERIMENTAL, \
1814 "trust final non-static declarations for constant folding") \
1815 \
1816 product(bool, FoldStableValues, true, DIAGNOSTIC, \
1817 "Optimize loads from stable fields (marked w/ @Stable)") \
1818 \
1819 product(int, UseBootstrapCallInfo, 1, DIAGNOSTIC, \
1820 "0: when resolving InDy or ConDy, force all BSM arguments to be " \
1821 "resolved before the bootstrap method is called; 1: when a BSM " \
1822 "that may accept a BootstrapCallInfo is detected, use that API " \
1823 "to pass BSM arguments, which allows the BSM to delay their " \
1824 "resolution; 2+: stress test the BCI API by calling more BSMs " \
1825 "via that API, instead of with the eagerly-resolved array.") \
1826 \
1827 product(bool, PauseAtStartup, false, DIAGNOSTIC, \
1828 "Causes the VM to pause at startup time and wait for the pause " \
1829 "file to be removed (default: ./vm.paused.<pid>)") \
1830 \
1831 product(ccstr, PauseAtStartupFile, nullptr, DIAGNOSTIC, \
1832 "The file to create and for whose removal to await when pausing " \
1833 "at startup. (default: ./vm.paused.<pid>)") \
1834 \
1835 product(bool, PauseAtExit, false, DIAGNOSTIC, \
1836 "Pause and wait for keypress on exit if a debugger is attached") \
1837 \
1838 product(bool, DTraceMethodProbes, false, \
1839 "Enable dtrace tool probes for method-entry and method-exit") \
1840 \
1841 product(bool, DTraceAllocProbes, false, \
1842 "Enable dtrace tool probes for object allocation") \
1843 \
1844 product(bool, DTraceMonitorProbes, false, \
1845 "Enable dtrace tool probes for monitor events") \
1846 \
1847 product(bool, RelaxAccessControlCheck, false, \
1848 "Relax the access control checks in the verifier") \
1849 \
1850 product(uintx, StringTableSize, defaultStringTableSize, \
1851 "Number of buckets in the interned String table " \
1852 "(will be rounded to nearest higher power of 2)") \
1853 range(minimumStringTableSize, 16777216ul /* 2^24 */) \
1854 \
1855 product(uintx, SymbolTableSize, defaultSymbolTableSize, EXPERIMENTAL, \
1856 "Number of buckets in the JVM internal Symbol table") \
1857 range(minimumSymbolTableSize, 16777216ul /* 2^24 */) \
1858 \
1859 product(bool, UseStringDeduplication, false, \
1860 "Use string deduplication") \
1861 \
1862 product(uint, StringDeduplicationAgeThreshold, 3, \
1863 "A string must reach this age (or be promoted to an old region) " \
1864 "to be considered for deduplication") \
1865 range(1, markWord::max_age) \
1866 \
1867 product(size_t, StringDeduplicationInitialTableSize, 500, EXPERIMENTAL, \
1868 "Approximate initial number of buckets in the table") \
1869 range(1, 1 * G) \
1870 \
1871 product(double, StringDeduplicationGrowTableLoad, 14.0, EXPERIMENTAL, \
1872 "Entries per bucket above which the table should be expanded") \
1873 range(0.1, 1000.0) \
1874 \
1875 product(double, StringDeduplicationShrinkTableLoad, 1.0, EXPERIMENTAL, \
1876 "Entries per bucket below which the table should be shrunk") \
1877 range(0.01, 100.0) \
1878 \
1879 product(double, StringDeduplicationTargetTableLoad, 7.0, EXPERIMENTAL, \
1880 "Desired entries per bucket when resizing the table") \
1881 range(0.01, 1000.0) \
1882 \
1883 product(size_t, StringDeduplicationCleanupDeadMinimum, 100, EXPERIMENTAL, \
1884 "Minimum number of dead table entries for cleaning the table") \
1885 \
1886 product(int, StringDeduplicationCleanupDeadPercent, 5, EXPERIMENTAL, \
1887 "Minimum percentage of dead table entries for cleaning the table") \
1888 range(1, 100) \
1889 \
1890 product(bool, StringDeduplicationResizeALot, false, DIAGNOSTIC, \
1891 "Force more frequent table resizing") \
1892 \
1893 product(uint64_t, StringDeduplicationHashSeed, 0, DIAGNOSTIC, \
1894 "Seed for the table hashing function; 0 requests computed seed") \
1895 \
1896 product(bool, WhiteBoxAPI, false, DIAGNOSTIC, \
1897 "Enable internal testing APIs") \
1898 \
1899 product(bool, AlwaysAtomicAccesses, false, EXPERIMENTAL, \
1900 "Accesses to all variables should always be atomic") \
1901 \
1902 product(bool, UseUnalignedAccesses, false, DIAGNOSTIC, \
1903 "Use unaligned memory accesses in Unsafe") \
1904 \
1905 product_pd(bool, PreserveFramePointer, \
1906 "Use the FP register for holding the frame pointer " \
1907 "and not as a general purpose register.") \
1908 \
1909 product(size_t, AsyncLogBufferSize, 2*M, \
1910 "Memory budget (in bytes) for the buffer of Asynchronous " \
1911 "Logging (-Xlog:async).") \
1912 range(DEBUG_ONLY(192) NOT_DEBUG(100*K), 50*M) \
1913 \
1914 product(bool, CheckIntrinsics, true, DIAGNOSTIC, \
1915 "When a class C is loaded, check that " \
1916 "(1) all intrinsics defined by the VM for class C are present "\
1917 "in the loaded class file and are marked with the " \
1918 "@IntrinsicCandidate annotation, that " \
1919 "(2) there is an intrinsic registered for all loaded methods " \
1920 "that are annotated with the @IntrinsicCandidate annotation, " \
1921 "and that " \
1922 "(3) no orphan methods exist for class C (i.e., methods for " \
1923 "which the VM declares an intrinsic but that are not declared "\
1924 "in the loaded class C. " \
1925 "Check (3) is available only in debug builds.") \
1926 \
1927 product_pd(intx, InitArrayShortSize, DIAGNOSTIC, \
1928 "Threshold small size (in bytes) for clearing arrays. " \
1929 "Anything this size or smaller may get converted to discrete " \
1930 "scalar stores.") \
1931 range(0, max_intx) \
1932 constraint(InitArrayShortSizeConstraintFunc, AfterErgo) \
1933 \
1934 product(ccstr, AllocateHeapAt, nullptr, \
1935 "Path to the directory where a temporary file will be created " \
1936 "to use as the backing store for Java Heap.") \
1937 \
1938 product_pd(bool, VMContinuations, EXPERIMENTAL, \
1939 "Enable VM continuations support") \
1940 \
1941 develop(bool, LoomDeoptAfterThaw, false, \
1942 "Deopt stack after thaw") \
1943 \
1944 develop(bool, LoomVerifyAfterThaw, false, \
1945 "Verify stack after thaw") \
1946 \
1947 develop(bool, VerifyContinuations, false, \
1948 "Verify continuation consistency") \
1949 \
1950 develop(bool, UseContinuationFastPath, true, \
1951 "Use fast-path frame walking in continuations") \
1952 \
1953 develop(int, VerifyMetaspaceInterval, DEBUG_ONLY(500) NOT_DEBUG(0), \
1954 "Run periodic metaspace verifications (0 - none, " \
1955 "1 - always, >1 every nth interval)") \
1956 \
1957 product(bool, ShowRegistersOnAssert, true, DIAGNOSTIC, \
1958 "On internal errors, include registers in error report.") \
1959 \
1960 product(bool, UseSwitchProfiling, true, DIAGNOSTIC, \
1961 "leverage profiling for table/lookup switch") \
1962 \
1963 develop(bool, TraceMemoryWriteback, false, \
1964 "Trace memory writeback operations") \
1965 \
1966 JFR_ONLY(product(bool, FlightRecorder, false, \
1967 "(Deprecated) Enable Flight Recorder")) \
1968 \
1969 JFR_ONLY(product(ccstr, FlightRecorderOptions, nullptr, \
1970 "Flight Recorder options")) \
1971 \
1972 JFR_ONLY(product(ccstr, StartFlightRecording, nullptr, \
1973 "Start flight recording with options")) \
1974 \
1975 product(bool, UseFastUnorderedTimeStamps, false, EXPERIMENTAL, \
1976 "Use platform unstable time where supported for timestamps only") \
1977 \
1978 product(bool, EnableValhalla, true, \
1979 "Enable experimental Valhalla features") \
1980 \
1981 product_pd(bool, InlineTypePassFieldsAsArgs, \
1982 "Pass each inline type field as an argument at calls") \
1983 \
1984 product_pd(bool, InlineTypeReturnedAsFields, \
1985 "Return fields instead of an inline type reference") \
1986 \
1987 develop(bool, StressCallingConvention, false, \
1988 "Stress the scalarized calling convention.") \
1989 \
1990 develop(bool, PreloadClasses, true, \
1991 "Preloading all classes from the LoadableDescriptors attribute") \
1992 \
1993 product(ccstrlist, ForceNonTearable, "", DIAGNOSTIC, \
1994 "List of inline classes which are forced to be atomic " \
1995 "(whitespace and commas separate names, " \
1996 "and leading and trailing stars '*' are wildcards)") \
1997 \
1998 product(bool, DeoptimizeNMethodBarriersALot, false, DIAGNOSTIC, \
1999 "Make nmethod barriers deoptimise a lot.") \
2000 \
2001 develop(bool, VerifyCrossModifyFence, \
2002 false AARCH64_ONLY(DEBUG_ONLY(||true)), \
2003 "Mark all threads after a safepoint, and clear on a modify " \
2004 "fence. Add cleanliness checks.") \
2005 \
2006 product(bool, UseObjectMonitorTable, false, DIAGNOSTIC, \
2007 "With Lightweight Locking mode, use a table to record inflated " \
2008 "monitors rather than the first word of the object.") \
2009 \
2010 product(int, LightweightFastLockingSpins, 13, DIAGNOSTIC, \
2011 "Specifies the number of times lightweight fast locking will " \
2012 "attempt to CAS the markWord before inflating. Between each " \
2013 "CAS it will spin for exponentially more time, resulting in " \
2014 "a total number of spins on the order of O(2^value)") \
2015 range(1, 30) \
2016 \
2017 product(uint, TrimNativeHeapInterval, 0, \
2018 "Interval, in ms, at which the JVM will trim the native heap if " \
2019 "the platform supports that. Lower values will reclaim memory " \
2020 "more eagerly at the cost of higher overhead. A value of 0 " \
2021 "(default) disables native heap trimming.") \
2022 range(0, UINT_MAX) \
2023 \
2024 develop(bool, SimulateFullAddressSpace, false, \
2025 "Simulates a very populated, fragmented address space; no " \
2026 "targeted reservations will succeed.") \
2027 \
2028 product(bool, ProfileExceptionHandlers, true, \
2029 "Profile exception handlers") \
2030 \
2031 product(bool, AlwaysRecordEvolDependencies, true, EXPERIMENTAL, \
2032 "Unconditionally record nmethod dependencies on class " \
2033 "rewriting/transformation independently of the JVMTI " \
2034 "can_{retransform/redefine}_classes capabilities.") \
2035 \
2036 product(bool, UseSecondarySupersCache, true, DIAGNOSTIC, \
2037 "Use secondary supers cache during subtype checks.") \
2038 \
2039 product(bool, UseSecondarySupersTable, false, DIAGNOSTIC, \
2040 "Use hash table to lookup secondary supers.") \
2041 \
2042 product(bool, VerifySecondarySupers, false, DIAGNOSTIC, \
2043 "Check that linear and hashed secondary lookups return the same result.") \
2044 \
2045 product(bool, StressSecondarySupers, false, DIAGNOSTIC, \
2046 "Use a terrible hash function in order to generate many collisions.") \
2047 \
2048 product(bool, UseThreadsLockThrottleLock, true, DIAGNOSTIC, \
2049 "Use an extra lock during Thread start and exit to alleviate" \
2050 "contention on Threads_lock.") \
2051 \
2052 develop(uint, BinarySearchThreshold, 16, \
2053 "Minimal number of elements in a sorted collection to prefer" \
2054 "binary search over simple linear search." ) \
2055 \
2056 product(bool, UseAltSubstitutabilityMethod, false, \
2057 "Use alternate version of the isSubstitutable method to " \
2058 "compare value class instances") \
2059
2060 // end of RUNTIME_FLAGS
2061
2062 DECLARE_FLAGS(LP64_RUNTIME_FLAGS)
2063 DECLARE_ARCH_FLAGS(ARCH_FLAGS)
2064 DECLARE_FLAGS(RUNTIME_FLAGS)
2065 DECLARE_FLAGS(RUNTIME_OS_FLAGS)
2066
2067 #endif // SHARE_RUNTIME_GLOBALS_HPP