author | sangheki |
Fri, 01 Apr 2016 09:45:50 -0700 | |
changeset 37234 | 07d212151499 |
parent 37233 | e8e674469545 |
child 37264 | d9b0f2b53b73 |
permissions | -rw-r--r-- |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
1 |
/* |
37054
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
4 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
8 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
13 |
* accompanied this code). |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
14 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
18 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
21 |
* questions. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
22 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
23 |
*/ |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
24 |
|
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
25 |
#include "precompiled.hpp" |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
26 |
#include "gc/shared/collectedHeap.hpp" |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
27 |
#include "gc/shared/collectorPolicy.hpp" |
37054
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
28 |
#include "gc/shared/genCollectedHeap.hpp" |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
29 |
#include "gc/shared/threadLocalAllocBuffer.hpp" |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
30 |
#include "runtime/arguments.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
31 |
#include "runtime/commandLineFlagConstraintsGC.hpp" |
32351 | 32 |
#include "runtime/commandLineFlagRangeList.hpp" |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
33 |
#include "runtime/globals.hpp" |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
34 |
#include "runtime/globals_extension.hpp" |
34661
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
35 |
#include "runtime/thread.inline.hpp" |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
36 |
#include "utilities/defaultStream.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
37 |
|
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
38 |
#if INCLUDE_ALL_GCS |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
39 |
#include "gc/g1/g1_globals.hpp" |
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
40 |
#include "gc/g1/heapRegionBounds.inline.hpp" |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
41 |
#include "gc/shared/plab.hpp" |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
42 |
#endif // INCLUDE_ALL_GCS |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
43 |
#ifdef COMPILER1 |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
44 |
#include "c1/c1_globals.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
45 |
#endif // COMPILER1 |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
46 |
#ifdef COMPILER2 |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
47 |
#include "opto/c2_globals.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
48 |
#endif // COMPILER2 |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
49 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
50 |
// Some flags that have default values that indicate that the |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
51 |
// JVM should automatically determine an appropriate value |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
52 |
// for that flag. In those cases it is only appropriate for the |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
53 |
// constraint checking to be done if the user has specified the |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
54 |
// value(s) of the flag(s) on the command line. In the constraint |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
55 |
// checking functions, FLAG_IS_CMDLINE() is used to check if |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
56 |
// the flag has been set by the user and so should be checked. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
57 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
58 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
59 |
static Flag::Error ParallelGCThreadsAndCMSWorkQueueDrainThreshold(uint threads, uintx threshold, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
60 |
// CMSWorkQueueDrainThreshold is verified to be less than max_juint |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
61 |
if (UseConcMarkSweepGC && (threads > (uint)(max_jint / (uint)threshold))) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
62 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
63 |
"ParallelGCThreads (" UINT32_FORMAT ") or CMSWorkQueueDrainThreshold (" |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
64 |
UINTX_FORMAT ") is too large\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
65 |
threads, threshold); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
66 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
67 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
68 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
69 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
70 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
71 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
72 |
// As ParallelGCThreads differs among GC modes, we need constraint function. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
73 |
Flag::Error ParallelGCThreadsConstraintFunc(uint value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
74 |
Flag::Error status = Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
75 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
76 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
77 |
// Parallel GC passes ParallelGCThreads when creating GrowableArray as 'int' type parameter. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
78 |
// So can't exceed with "max_jint" |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
79 |
if (UseParallelGC && (value > (uint)max_jint)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
80 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
81 |
"ParallelGCThreads (" UINT32_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
82 |
"less than or equal to " UINT32_FORMAT " for Parallel GC\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
83 |
value, max_jint); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
84 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
85 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
86 |
// To avoid overflow at ParScanClosure::do_oop_work. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
87 |
if (UseConcMarkSweepGC && (value > (max_jint / 10))) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
88 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
89 |
"ParallelGCThreads (" UINT32_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
90 |
"less than or equal to " UINT32_FORMAT " for CMS GC\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
91 |
value, (max_jint / 10)); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
92 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
93 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
94 |
status = ParallelGCThreadsAndCMSWorkQueueDrainThreshold(value, CMSWorkQueueDrainThreshold, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
95 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
96 |
return status; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
97 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
98 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
99 |
// As ConcGCThreads should be smaller than ParallelGCThreads, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
100 |
// we need constraint function. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
101 |
Flag::Error ConcGCThreadsConstraintFunc(uint value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
102 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
103 |
// CMS and G1 GCs use ConcGCThreads. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
104 |
if ((UseConcMarkSweepGC || UseG1GC) && (value > ParallelGCThreads)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
105 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
106 |
"ConcGCThreads (" UINT32_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
107 |
"less than or equal to ParallelGCThreads (" UINT32_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
108 |
value, ParallelGCThreads); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
109 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
110 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
111 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
112 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
113 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
114 |
|
32351 | 115 |
static Flag::Error MinPLABSizeBounds(const char* name, size_t value, bool verbose) { |
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
116 |
#if INCLUDE_ALL_GCS |
37234
07d212151499
8153201: TestOptionsWithRanges fails with -XX:OldPLABSize=2147483648
sangheki
parents:
37233
diff
changeset
|
117 |
if ((UseConcMarkSweepGC || UseG1GC || UseParallelGC) && (value < PLAB::min_size())) { |
32351 | 118 |
CommandLineError::print(verbose, |
119 |
"%s (" SIZE_FORMAT ") must be " |
|
120 |
"greater than or equal to ergonomic PLAB minimum size (" SIZE_FORMAT ")\n", |
|
121 |
name, value, PLAB::min_size()); |
|
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
122 |
return Flag::VIOLATES_CONSTRAINT; |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
123 |
} |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
124 |
#endif // INCLUDE_ALL_GCS |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
125 |
return Flag::SUCCESS; |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
126 |
} |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
127 |
|
32351 | 128 |
static Flag::Error MaxPLABSizeBounds(const char* name, size_t value, bool verbose) { |
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
129 |
#if INCLUDE_ALL_GCS |
37234
07d212151499
8153201: TestOptionsWithRanges fails with -XX:OldPLABSize=2147483648
sangheki
parents:
37233
diff
changeset
|
130 |
if ((UseConcMarkSweepGC || UseG1GC || UseParallelGC) && (value > PLAB::max_size())) { |
32351 | 131 |
CommandLineError::print(verbose, |
132 |
"%s (" SIZE_FORMAT ") must be " |
|
32601
c5df671276bd
8078555: GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32351
diff
changeset
|
133 |
"less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n", |
32610
bf513f9f3fb9
8134856: Incorrect use of PLAB::min_size() in MaxPLABSizeBounds
tschatzl
parents:
32601
diff
changeset
|
134 |
name, value, PLAB::max_size()); |
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
135 |
return Flag::VIOLATES_CONSTRAINT; |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
136 |
} |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
137 |
#endif // INCLUDE_ALL_GCS |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
138 |
return Flag::SUCCESS; |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
139 |
} |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
140 |
|
32351 | 141 |
static Flag::Error MinMaxPLABSizeBounds(const char* name, size_t value, bool verbose) { |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
142 |
Flag::Error status = MinPLABSizeBounds(name, value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
143 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
144 |
if (status == Flag::SUCCESS) { |
32351 | 145 |
return MaxPLABSizeBounds(name, value, verbose); |
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
146 |
} |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
147 |
return status; |
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
148 |
} |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
149 |
|
32351 | 150 |
Flag::Error YoungPLABSizeConstraintFunc(size_t value, bool verbose) { |
151 |
return MinMaxPLABSizeBounds("YoungPLABSize", value, verbose); |
|
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
152 |
} |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
153 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
154 |
Flag::Error OldPLABSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
155 |
Flag::Error status = Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
156 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
157 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
158 |
if (UseConcMarkSweepGC) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
159 |
if (value == 0) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
160 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
161 |
"OldPLABSize (" SIZE_FORMAT ") must be greater than 0", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
162 |
value); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
163 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
164 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
165 |
// For CMS, OldPLABSize is the number of free blocks of a given size that are used when |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
166 |
// replenishing the local per-worker free list caches. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
167 |
// For more details, please refer to Arguments::set_cms_and_parnew_gc_flags(). |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
168 |
status = MaxPLABSizeBounds("OldPLABSize", value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
169 |
} else { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
170 |
status = MinMaxPLABSizeBounds("OldPLABSize", value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
171 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
172 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
173 |
return status; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
174 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
175 |
|
32351 | 176 |
Flag::Error MinHeapFreeRatioConstraintFunc(uintx value, bool verbose) { |
177 |
if (value > MaxHeapFreeRatio) { |
|
178 |
CommandLineError::print(verbose, |
|
179 |
"MinHeapFreeRatio (" UINTX_FORMAT ") must be " |
|
180 |
"less than or equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n", |
|
181 |
value, MaxHeapFreeRatio); |
|
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
182 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
183 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
184 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
185 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
186 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
187 |
|
32351 | 188 |
Flag::Error MaxHeapFreeRatioConstraintFunc(uintx value, bool verbose) { |
189 |
if (value < MinHeapFreeRatio) { |
|
190 |
CommandLineError::print(verbose, |
|
191 |
"MaxHeapFreeRatio (" UINTX_FORMAT ") must be " |
|
192 |
"greater than or equal to MinHeapFreeRatio (" UINTX_FORMAT ")\n", |
|
193 |
value, MinHeapFreeRatio); |
|
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
194 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
195 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
196 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
197 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
198 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
199 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
200 |
static Flag::Error CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB(size_t maxHeap, intx softRef, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
201 |
if ((softRef > 0) && ((maxHeap / M) > (max_uintx / softRef))) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
202 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
203 |
"Desired lifetime of SoftReferences cannot be expressed correctly. " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
204 |
"MaxHeapSize (" SIZE_FORMAT ") or SoftRefLRUPolicyMSPerMB " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
205 |
"(" INTX_FORMAT ") is too large\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
206 |
maxHeap, softRef); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
207 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
208 |
} else { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
209 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
210 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
211 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
212 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
213 |
Flag::Error SoftRefLRUPolicyMSPerMBConstraintFunc(intx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
214 |
return CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB(MaxHeapSize, value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
215 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
216 |
|
32351 | 217 |
Flag::Error MinMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose) { |
218 |
if (value > MaxMetaspaceFreeRatio) { |
|
219 |
CommandLineError::print(verbose, |
|
220 |
"MinMetaspaceFreeRatio (" UINTX_FORMAT ") must be " |
|
221 |
"less than or equal to MaxMetaspaceFreeRatio (" UINTX_FORMAT ")\n", |
|
222 |
value, MaxMetaspaceFreeRatio); |
|
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
223 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
224 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
225 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
226 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
227 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
228 |
|
32351 | 229 |
Flag::Error MaxMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose) { |
230 |
if (value < MinMetaspaceFreeRatio) { |
|
231 |
CommandLineError::print(verbose, |
|
232 |
"MaxMetaspaceFreeRatio (" UINTX_FORMAT ") must be " |
|
233 |
"greater than or equal to MinMetaspaceFreeRatio (" UINTX_FORMAT ")\n", |
|
234 |
value, MinMetaspaceFreeRatio); |
|
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
235 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
236 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
237 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
238 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
239 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
240 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
241 |
Flag::Error InitialTenuringThresholdConstraintFunc(uintx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
242 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
243 |
// InitialTenuringThreshold is only used for ParallelGC. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
244 |
if (UseParallelGC && (value > MaxTenuringThreshold)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
245 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
246 |
"InitialTenuringThreshold (" UINTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
247 |
"less than or equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
248 |
value, MaxTenuringThreshold); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
249 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
250 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
251 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
252 |
return Flag::SUCCESS; |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
253 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
254 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
255 |
Flag::Error MaxTenuringThresholdConstraintFunc(uintx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
256 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
257 |
// As only ParallelGC uses InitialTenuringThreshold, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
258 |
// we don't need to compare InitialTenuringThreshold with MaxTenuringThreshold. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
259 |
if (UseParallelGC && (value < InitialTenuringThreshold)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
260 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
261 |
"MaxTenuringThreshold (" UINTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
262 |
"greater than or equal to InitialTenuringThreshold (" UINTX_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
263 |
value, InitialTenuringThreshold); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
264 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
265 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
266 |
#endif |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
267 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
268 |
// MaxTenuringThreshold=0 means NeverTenure=false && AlwaysTenure=true |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
269 |
if ((value == 0) && (NeverTenure || !AlwaysTenure)) { |
32351 | 270 |
CommandLineError::print(verbose, |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
271 |
"MaxTenuringThreshold (0) should match to NeverTenure=false " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
272 |
"&& AlwaysTenure=true. But we have NeverTenure=%s " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
273 |
"AlwaysTenure=%s\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
274 |
NeverTenure ? "true" : "false", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
275 |
AlwaysTenure ? "true" : "false"); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
276 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
277 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
278 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
279 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
280 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
281 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
282 |
Flag::Error G1RSetRegionEntriesConstraintFunc(intx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
283 |
if (!UseG1GC) return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
284 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
285 |
// Default value of G1RSetRegionEntries=0 means will be set ergonomically. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
286 |
// Minimum value is 1. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
287 |
if (FLAG_IS_CMDLINE(G1RSetRegionEntries) && (value < 1)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
288 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
289 |
"G1RSetRegionEntries (" INTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
290 |
"greater than or equal to 1\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
291 |
value); |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
292 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
293 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
294 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
295 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
296 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
297 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
298 |
Flag::Error G1RSetSparseRegionEntriesConstraintFunc(intx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
299 |
if (!UseG1GC) return Flag::SUCCESS; |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
300 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
301 |
// Default value of G1RSetSparseRegionEntries=0 means will be set ergonomically. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
302 |
// Minimum value is 1. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
303 |
if (FLAG_IS_CMDLINE(G1RSetSparseRegionEntries) && (value < 1)) { |
32351 | 304 |
CommandLineError::print(verbose, |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
305 |
"G1RSetSparseRegionEntries (" INTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
306 |
"greater than or equal to 1\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
307 |
value); |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
308 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
309 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
310 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
311 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
312 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
313 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
314 |
Flag::Error G1YoungSurvRateNumRegionsSummaryConstraintFunc(intx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
315 |
if (!UseG1GC) return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
316 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
317 |
if (value > (intx)HeapRegionBounds::target_number()) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
318 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
319 |
"G1YoungSurvRateNumRegionsSummary (" INTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
320 |
"less than or equal to region count (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
321 |
value, HeapRegionBounds::target_number()); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
322 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
323 |
} else { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
324 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
325 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
326 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
327 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
328 |
Flag::Error G1HeapRegionSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
329 |
if (!UseG1GC) return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
330 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
331 |
// Default value of G1HeapRegionSize=0 means will be set ergonomically. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
332 |
if (FLAG_IS_CMDLINE(G1HeapRegionSize) && (value < HeapRegionBounds::min_size())) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
333 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
334 |
"G1HeapRegionSize (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
335 |
"greater than or equal to ergonomic heap region minimum size\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
336 |
value); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
337 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
338 |
} else { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
339 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
340 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
341 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
342 |
|
32351 | 343 |
Flag::Error G1NewSizePercentConstraintFunc(uintx value, bool verbose) { |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
344 |
if (!UseG1GC) return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
345 |
|
32351 | 346 |
if (value > G1MaxNewSizePercent) { |
347 |
CommandLineError::print(verbose, |
|
348 |
"G1NewSizePercent (" UINTX_FORMAT ") must be " |
|
349 |
"less than or equal to G1MaxNewSizePercent (" UINTX_FORMAT ")\n", |
|
350 |
value, G1MaxNewSizePercent); |
|
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
351 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
352 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
353 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
354 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
355 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
356 |
|
32351 | 357 |
Flag::Error G1MaxNewSizePercentConstraintFunc(uintx value, bool verbose) { |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
358 |
if (!UseG1GC) return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
359 |
|
32351 | 360 |
if (value < G1NewSizePercent) { |
361 |
CommandLineError::print(verbose, |
|
362 |
"G1MaxNewSizePercent (" UINTX_FORMAT ") must be " |
|
363 |
"greater than or equal to G1NewSizePercent (" UINTX_FORMAT ")\n", |
|
364 |
value, G1NewSizePercent); |
|
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
365 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
366 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
367 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
368 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
369 |
} |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
370 |
#endif // INCLUDE_ALL_GCS |
32613
73bec9f941d7
8134972: [BACKOUT] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32610
diff
changeset
|
371 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
372 |
Flag::Error ParGCStridesPerThreadConstraintFunc(uintx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
373 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
374 |
if (UseConcMarkSweepGC && (value > ((uintx)max_jint / (uintx)ParallelGCThreads))) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
375 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
376 |
"ParGCStridesPerThread (" UINTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
377 |
"less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
378 |
value, ((uintx)max_jint / (uintx)ParallelGCThreads)); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
379 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
380 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
381 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
382 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
383 |
} |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
384 |
|
37233
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
385 |
Flag::Error ParGCCardsPerStrideChunkConstraintFunc(intx value, bool verbose) { |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
386 |
#if INCLUDE_ALL_GCS |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
387 |
if (UseConcMarkSweepGC) { |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
388 |
// ParGCCardsPerStrideChunk should be compared with card table size. |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
389 |
size_t heap_size = Universe::heap()->reserved_region().word_size(); |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
390 |
CardTableModRefBS* bs = (CardTableModRefBS*)GenCollectedHeap::heap()->rem_set()->bs(); |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
391 |
size_t card_table_size = bs->cards_required(heap_size) - 1; // Valid card table size |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
392 |
|
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
393 |
if ((size_t)value > card_table_size) { |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
394 |
CommandLineError::print(verbose, |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
395 |
"ParGCCardsPerStrideChunk (" INTX_FORMAT ") is too large for the heap size and " |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
396 |
"must be less than or equal to card table size (" SIZE_FORMAT ")\n", |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
397 |
value, card_table_size); |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
398 |
return Flag::VIOLATES_CONSTRAINT; |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
399 |
} |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
400 |
|
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
401 |
// ParGCCardsPerStrideChunk is used with n_strides(ParallelGCThreads*ParGCStridesPerThread) |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
402 |
// from CardTableModRefBSForCTRS::process_stride(). Note that ParGCStridesPerThread is already checked |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
403 |
// not to make an overflow with ParallelGCThreads from its constraint function. |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
404 |
uintx n_strides = ParallelGCThreads * ParGCStridesPerThread; |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
405 |
uintx ergo_max = max_uintx / n_strides; |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
406 |
if ((uintx)value > ergo_max) { |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
407 |
CommandLineError::print(verbose, |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
408 |
"ParGCCardsPerStrideChunk (" INTX_FORMAT ") must be " |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
409 |
"less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n", |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
410 |
value, ergo_max); |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
411 |
return Flag::VIOLATES_CONSTRAINT; |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
412 |
} |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
413 |
} |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
414 |
#endif |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
415 |
return Flag::SUCCESS; |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
416 |
} |
e8e674469545
8152176: Big ParGCCardsPerStrideChunk values can cause overflow for CMS GC
sangheki
parents:
37157
diff
changeset
|
417 |
|
32351 | 418 |
Flag::Error CMSOldPLABMinConstraintFunc(size_t value, bool verbose) { |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
419 |
Flag::Error status = Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
420 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
421 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
422 |
if (UseConcMarkSweepGC) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
423 |
if (value > CMSOldPLABMax) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
424 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
425 |
"CMSOldPLABMin (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
426 |
"less than or equal to CMSOldPLABMax (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
427 |
value, CMSOldPLABMax); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
428 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
429 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
430 |
status = MaxPLABSizeBounds("CMSOldPLABMin", value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
431 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
432 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
433 |
return status; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
434 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
435 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
436 |
Flag::Error CMSOldPLABMaxConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
437 |
Flag::Error status = Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
438 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
439 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
440 |
if (UseConcMarkSweepGC) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
441 |
status = MaxPLABSizeBounds("CMSOldPLABMax", value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
442 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
443 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
444 |
return status; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
445 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
446 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
447 |
Flag::Error MarkStackSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
448 |
if (value > MarkStackSizeMax) { |
32351 | 449 |
CommandLineError::print(verbose, |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
450 |
"MarkStackSize (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
451 |
"less than or equal to MarkStackSizeMax (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
452 |
value, MarkStackSizeMax); |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
453 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
454 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
455 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
456 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
457 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
458 |
|
32351 | 459 |
Flag::Error CMSPrecleanDenominatorConstraintFunc(uintx value, bool verbose) { |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
460 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
461 |
if (UseConcMarkSweepGC && (value <= CMSPrecleanNumerator)) { |
32351 | 462 |
CommandLineError::print(verbose, |
463 |
"CMSPrecleanDenominator (" UINTX_FORMAT ") must be " |
|
464 |
"strickly greater than CMSPrecleanNumerator (" UINTX_FORMAT ")\n", |
|
465 |
value, CMSPrecleanNumerator); |
|
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
466 |
return Flag::VIOLATES_CONSTRAINT; |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
467 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
468 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
469 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
470 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
471 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
472 |
Flag::Error CMSPrecleanNumeratorConstraintFunc(uintx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
473 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
474 |
if (UseConcMarkSweepGC && (value >= CMSPrecleanDenominator)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
475 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
476 |
"CMSPrecleanNumerator (" UINTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
477 |
"less than CMSPrecleanDenominator (" UINTX_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
478 |
value, CMSPrecleanDenominator); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
479 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
480 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
481 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
482 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
483 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
484 |
|
37054
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
485 |
Flag::Error CMSSamplingGrainConstraintFunc(uintx value, bool verbose) { |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
486 |
#if INCLUDE_ALL_GCS |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
487 |
if (UseConcMarkSweepGC) { |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
488 |
size_t max_capacity = GenCollectedHeap::heap()->young_gen()->max_capacity(); |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
489 |
if (value > max_uintx - max_capacity) { |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
490 |
CommandLineError::print(verbose, |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
491 |
"CMSSamplingGrain (" UINTX_FORMAT ") must be " |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
492 |
"less than or equal to ergonomic maximum (" SIZE_FORMAT ")\n", |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
493 |
value, max_uintx - max_capacity); |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
494 |
return Flag::VIOLATES_CONSTRAINT; |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
495 |
} |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
496 |
} |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
497 |
#endif |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
498 |
return Flag::SUCCESS; |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
499 |
} |
31d83caf01e8
8145312: CMS: There is insufficient memory with CMSSamplingGrain=1
sangheki
parents:
35203
diff
changeset
|
500 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
501 |
Flag::Error CMSWorkQueueDrainThresholdConstraintFunc(uintx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
502 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
503 |
if (UseConcMarkSweepGC) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
504 |
return ParallelGCThreadsAndCMSWorkQueueDrainThreshold(ParallelGCThreads, value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
505 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
506 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
507 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
508 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
509 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
510 |
Flag::Error MaxGCPauseMillisConstraintFunc(uintx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
511 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
512 |
if (UseG1GC && FLAG_IS_CMDLINE(MaxGCPauseMillis) && (value >= GCPauseIntervalMillis)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
513 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
514 |
"MaxGCPauseMillis (" UINTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
515 |
"less than GCPauseIntervalMillis (" UINTX_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
516 |
value, GCPauseIntervalMillis); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
517 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
518 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
519 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
520 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
521 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
522 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
523 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
524 |
Flag::Error GCPauseIntervalMillisConstraintFunc(uintx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
525 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
526 |
if (UseG1GC) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
527 |
if (FLAG_IS_CMDLINE(GCPauseIntervalMillis)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
528 |
if (value < 1) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
529 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
530 |
"GCPauseIntervalMillis (" UINTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
531 |
"greater than or equal to 1\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
532 |
value); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
533 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
534 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
535 |
if (value <= MaxGCPauseMillis) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
536 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
537 |
"GCPauseIntervalMillis (" UINTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
538 |
"greater than MaxGCPauseMillis (" UINTX_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
539 |
value, MaxGCPauseMillis); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
540 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
541 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
542 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
543 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
544 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
545 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
546 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
547 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
548 |
Flag::Error InitialBootClassLoaderMetaspaceSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
549 |
size_t aligned_max = (size_t)align_size_down(max_uintx/2, Metaspace::reserve_alignment_words()); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
550 |
if (value > aligned_max) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
551 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
552 |
"InitialBootClassLoaderMetaspaceSize (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
553 |
"less than or equal to aligned maximum value (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
554 |
value, aligned_max); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
555 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
556 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
557 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
558 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
559 |
|
34661
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
560 |
// To avoid an overflow by 'align_size_up(value, alignment)'. |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
561 |
static Flag::Error MaxSizeForAlignment(const char* name, size_t value, size_t alignment, bool verbose) { |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
562 |
size_t aligned_max = ((max_uintx - alignment) & ~(alignment-1)); |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
563 |
if (value > aligned_max) { |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
564 |
CommandLineError::print(verbose, |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
565 |
"%s (" SIZE_FORMAT ") must be " |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
566 |
"less than or equal to aligned maximum value (" SIZE_FORMAT ")\n", |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
567 |
name, value, aligned_max); |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
568 |
return Flag::VIOLATES_CONSTRAINT; |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
569 |
} |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
570 |
return Flag::SUCCESS; |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
571 |
} |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
572 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
573 |
static Flag::Error MaxSizeForHeapAlignment(const char* name, size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
574 |
// For G1 GC, we don't know until G1CollectorPolicy is created. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
575 |
size_t heap_alignment; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
576 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
577 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
578 |
if (UseG1GC) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
579 |
heap_alignment = HeapRegionBounds::max_size(); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
580 |
} else |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
581 |
#endif |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
582 |
{ |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
583 |
heap_alignment = CollectorPolicy::compute_heap_alignment(); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
584 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
585 |
|
34661
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
586 |
return MaxSizeForAlignment(name, value, heap_alignment, verbose); |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
587 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
588 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
589 |
Flag::Error InitialHeapSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
590 |
return MaxSizeForHeapAlignment("InitialHeapSize", value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
591 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
592 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
593 |
Flag::Error MaxHeapSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
594 |
Flag::Error status = MaxSizeForHeapAlignment("MaxHeapSize", value, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
595 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
596 |
if (status == Flag::SUCCESS) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
597 |
status = CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB(value, SoftRefLRUPolicyMSPerMB, verbose); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
598 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
599 |
return status; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
600 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
601 |
|
34661
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
602 |
Flag::Error HeapBaseMinAddressConstraintFunc(size_t value, bool verbose) { |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
603 |
// If an overflow happened in Arguments::set_heap_size(), MaxHeapSize will have too large a value. |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
604 |
// Check for this by ensuring that MaxHeapSize plus the requested min base address still fit within max_uintx. |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
605 |
if (UseCompressedOops && FLAG_IS_ERGO(MaxHeapSize) && (value > (max_uintx - MaxHeapSize))) { |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
606 |
CommandLineError::print(verbose, |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
607 |
"HeapBaseMinAddress (" SIZE_FORMAT ") or MaxHeapSize (" SIZE_FORMAT ") is too large. " |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
608 |
"Sum of them must be less than or equal to maximum of size_t (" SIZE_FORMAT ")\n", |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
609 |
value, MaxHeapSize, max_uintx); |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
610 |
return Flag::VIOLATES_CONSTRAINT; |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
611 |
} |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
612 |
|
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
613 |
return MaxSizeForHeapAlignment("HeapBaseMinAddress", value, verbose); |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
614 |
} |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
615 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
616 |
Flag::Error NewSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
617 |
#ifdef _LP64 |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
618 |
#if INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
619 |
// Overflow would happen for uint type variable of YoungGenSizer::_min_desired_young_length |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
620 |
// when the value to be assigned exceeds uint range. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
621 |
// i.e. result of '(uint)(NewSize / region size(1~32MB))' |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
622 |
// So maximum of NewSize should be 'max_juint * 1M' |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
623 |
if (UseG1GC && (value > (max_juint * 1 * M))) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
624 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
625 |
"NewSize (" SIZE_FORMAT ") must be less than ergonomic maximum value\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
626 |
value); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
627 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
628 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
629 |
#endif // INCLUDE_ALL_GCS |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
630 |
#endif // _LP64 |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
631 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
632 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
633 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
634 |
Flag::Error MinTLABSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
635 |
// At least, alignment reserve area is needed. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
636 |
if (value < ThreadLocalAllocBuffer::alignment_reserve_in_bytes()) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
637 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
638 |
"MinTLABSize (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
639 |
"greater than or equal to reserved area in TLAB (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
640 |
value, ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
641 |
return Flag::VIOLATES_CONSTRAINT; |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
642 |
} |
37157
2a0fdb3e2a19
8152118: MinTLABSize should be less than TLAB max
sangheki
parents:
37054
diff
changeset
|
643 |
if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) { |
2a0fdb3e2a19
8152118: MinTLABSize should be less than TLAB max
sangheki
parents:
37054
diff
changeset
|
644 |
CommandLineError::print(verbose, |
2a0fdb3e2a19
8152118: MinTLABSize should be less than TLAB max
sangheki
parents:
37054
diff
changeset
|
645 |
"MinTLABSize (" SIZE_FORMAT ") must be " |
2a0fdb3e2a19
8152118: MinTLABSize should be less than TLAB max
sangheki
parents:
37054
diff
changeset
|
646 |
"less than or equal to ergonomic TLAB maximum (" SIZE_FORMAT ")\n", |
2a0fdb3e2a19
8152118: MinTLABSize should be less than TLAB max
sangheki
parents:
37054
diff
changeset
|
647 |
value, ThreadLocalAllocBuffer::max_size() * HeapWordSize); |
2a0fdb3e2a19
8152118: MinTLABSize should be less than TLAB max
sangheki
parents:
37054
diff
changeset
|
648 |
return Flag::VIOLATES_CONSTRAINT; |
2a0fdb3e2a19
8152118: MinTLABSize should be less than TLAB max
sangheki
parents:
37054
diff
changeset
|
649 |
} |
2a0fdb3e2a19
8152118: MinTLABSize should be less than TLAB max
sangheki
parents:
37054
diff
changeset
|
650 |
return Flag::SUCCESS; |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
651 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
652 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
653 |
Flag::Error TLABSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
654 |
// Skip for default value of zero which means set ergonomically. |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
655 |
if (FLAG_IS_CMDLINE(TLABSize)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
656 |
if (value < MinTLABSize) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
657 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
658 |
"TLABSize (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
659 |
"greater than or equal to MinTLABSize (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
660 |
value, MinTLABSize); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
661 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
662 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
663 |
if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
664 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
665 |
"TLABSize (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
666 |
"less than or equal to ergonomic TLAB maximum size (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
667 |
value, (ThreadLocalAllocBuffer::max_size() * HeapWordSize)); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
668 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
669 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
670 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
671 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
672 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
673 |
|
34661
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
674 |
// We will protect overflow from ThreadLocalAllocBuffer::record_slow_allocation(), |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
675 |
// so AfterMemoryInit type is enough to check. |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
676 |
Flag::Error TLABWasteIncrementConstraintFunc(uintx value, bool verbose) { |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
677 |
if (UseTLAB) { |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
678 |
size_t refill_waste_limit = Thread::current()->tlab().refill_waste_limit(); |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
679 |
|
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
680 |
// Compare with 'max_uintx' as ThreadLocalAllocBuffer::_refill_waste_limit is 'size_t'. |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
681 |
if (refill_waste_limit > (max_uintx - value)) { |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
682 |
CommandLineError::print(verbose, |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
683 |
"TLABWasteIncrement (" UINTX_FORMAT ") must be " |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
684 |
"less than or equal to ergonomic TLAB waste increment maximum size(" SIZE_FORMAT ")\n", |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
685 |
value, (max_uintx - refill_waste_limit)); |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
686 |
return Flag::VIOLATES_CONSTRAINT; |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
687 |
} |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
688 |
} |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
689 |
return Flag::SUCCESS; |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
690 |
} |
9a1d11d88ea0
8142341: GC: current flags need ranges to be implemented
sangheki
parents:
33144
diff
changeset
|
691 |
|
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
692 |
Flag::Error SurvivorRatioConstraintFunc(uintx value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
693 |
if (FLAG_IS_CMDLINE(SurvivorRatio) && |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
694 |
(value > (MaxHeapSize / Universe::heap()->collector_policy()->space_alignment()))) { |
32351 | 695 |
CommandLineError::print(verbose, |
33144
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
696 |
"SurvivorRatio (" UINTX_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
697 |
"less than or equal to ergonomic SurvivorRatio maximum (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
698 |
value, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
699 |
(MaxHeapSize / Universe::heap()->collector_policy()->space_alignment())); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
700 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
701 |
} else { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
702 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
703 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
704 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
705 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
706 |
Flag::Error MetaspaceSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
707 |
if (value > MaxMetaspaceSize) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
708 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
709 |
"MetaspaceSize (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
710 |
"less than or equal to MaxMetaspaceSize (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
711 |
value, MaxMetaspaceSize); |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
712 |
return Flag::VIOLATES_CONSTRAINT; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
713 |
} else { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
714 |
return Flag::SUCCESS; |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
715 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
716 |
} |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
717 |
|
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
718 |
Flag::Error MaxMetaspaceSizeConstraintFunc(size_t value, bool verbose) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
719 |
if (value < MetaspaceSize) { |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
720 |
CommandLineError::print(verbose, |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
721 |
"MaxMetaspaceSize (" SIZE_FORMAT ") must be " |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
722 |
"greater than or equal to MetaspaceSize (" SIZE_FORMAT ")\n", |
c56850e328fc
8134995: [REDO] GC: implement ranges (optionally constraints) for those flags that have them missing
sangheki
parents:
32613
diff
changeset
|
723 |
value, MaxMetaspaceSize); |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
724 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
725 |
} else { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
726 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
727 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
728 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
729 |
|
32351 | 730 |
Flag::Error SurvivorAlignmentInBytesConstraintFunc(intx value, bool verbose) { |
731 |
if (value != 0) { |
|
732 |
if (!is_power_of_2(value)) { |
|
733 |
CommandLineError::print(verbose, |
|
734 |
"SurvivorAlignmentInBytes (" INTX_FORMAT ") must be " |
|
735 |
"power of 2\n", |
|
736 |
value); |
|
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
737 |
return Flag::VIOLATES_CONSTRAINT; |
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
738 |
} |
32351 | 739 |
if (value < ObjectAlignmentInBytes) { |
740 |
CommandLineError::print(verbose, |
|
741 |
"SurvivorAlignmentInBytes (" INTX_FORMAT ") must be " |
|
742 |
"greater than or equal to ObjectAlignmentInBytes (" INTX_FORMAT ")\n", |
|
743 |
value, ObjectAlignmentInBytes); |
|
31995
aa4049b4184a
8130459: Add additional validation after heap creation
sangheki
parents:
31371
diff
changeset
|
744 |
return Flag::VIOLATES_CONSTRAINT; |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
745 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
746 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
747 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
748 |
} |