21 * questions. |
21 * questions. |
22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "runtime/flags/jvmFlagRangeList.hpp" |
26 #include "gc/parallel/jvmFlagConstraintsParallel.hpp" |
27 #include "runtime/globals.hpp" |
27 #include "runtime/globals.hpp" |
28 #include "utilities/globalDefinitions.hpp" |
28 #include "utilities/globalDefinitions.hpp" |
29 |
29 |
30 JVMFlag::Error ParallelGCThreadsConstraintFuncParallel(uint value, bool verbose) { |
30 JVMFlag::Error ParallelGCThreadsConstraintFuncParallel(uint value, bool verbose) { |
31 // Parallel GC passes ParallelGCThreads when creating GrowableArray as 'int' type parameter. |
31 // Parallel GC passes ParallelGCThreads when creating GrowableArray as 'int' type parameter. |
32 // So can't exceed with "max_jint" |
32 // So can't exceed with "max_jint" |
33 |
33 |
34 if (UseParallelGC && (value > (uint)max_jint)) { |
34 if (UseParallelGC && (value > (uint)max_jint)) { |
35 CommandLineError::print(verbose, |
35 JVMFlag::printError(verbose, |
36 "ParallelGCThreads (" UINT32_FORMAT ") must be " |
36 "ParallelGCThreads (" UINT32_FORMAT ") must be " |
37 "less than or equal to " UINT32_FORMAT " for Parallel GC\n", |
37 "less than or equal to " UINT32_FORMAT " for Parallel GC\n", |
38 value, max_jint); |
38 value, max_jint); |
39 return JVMFlag::VIOLATES_CONSTRAINT; |
39 return JVMFlag::VIOLATES_CONSTRAINT; |
40 } |
40 } |
41 return JVMFlag::SUCCESS; |
41 return JVMFlag::SUCCESS; |
42 } |
42 } |
43 |
43 |
44 JVMFlag::Error InitialTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) { |
44 JVMFlag::Error InitialTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) { |
45 // InitialTenuringThreshold is only used for ParallelGC. |
45 // InitialTenuringThreshold is only used for ParallelGC. |
46 if (UseParallelGC && (value > MaxTenuringThreshold)) { |
46 if (UseParallelGC && (value > MaxTenuringThreshold)) { |
47 CommandLineError::print(verbose, |
47 JVMFlag::printError(verbose, |
48 "InitialTenuringThreshold (" UINTX_FORMAT ") must be " |
48 "InitialTenuringThreshold (" UINTX_FORMAT ") must be " |
49 "less than or equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n", |
49 "less than or equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n", |
50 value, MaxTenuringThreshold); |
50 value, MaxTenuringThreshold); |
51 return JVMFlag::VIOLATES_CONSTRAINT; |
51 return JVMFlag::VIOLATES_CONSTRAINT; |
52 } |
52 } |
53 return JVMFlag::SUCCESS; |
53 return JVMFlag::SUCCESS; |
54 } |
54 } |
55 |
55 |
56 JVMFlag::Error MaxTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) { |
56 JVMFlag::Error MaxTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) { |
57 // As only ParallelGC uses InitialTenuringThreshold, |
57 // As only ParallelGC uses InitialTenuringThreshold, |
58 // we don't need to compare InitialTenuringThreshold with MaxTenuringThreshold. |
58 // we don't need to compare InitialTenuringThreshold with MaxTenuringThreshold. |
59 if (UseParallelGC && (value < InitialTenuringThreshold)) { |
59 if (UseParallelGC && (value < InitialTenuringThreshold)) { |
60 CommandLineError::print(verbose, |
60 JVMFlag::printError(verbose, |
61 "MaxTenuringThreshold (" UINTX_FORMAT ") must be " |
61 "MaxTenuringThreshold (" UINTX_FORMAT ") must be " |
62 "greater than or equal to InitialTenuringThreshold (" UINTX_FORMAT ")\n", |
62 "greater than or equal to InitialTenuringThreshold (" UINTX_FORMAT ")\n", |
63 value, InitialTenuringThreshold); |
63 value, InitialTenuringThreshold); |
64 return JVMFlag::VIOLATES_CONSTRAINT; |
64 return JVMFlag::VIOLATES_CONSTRAINT; |
65 } |
65 } |
66 |
66 |
67 return JVMFlag::SUCCESS; |
67 return JVMFlag::SUCCESS; |
68 } |
68 } |