Skip to content

Commit

Permalink
moving ParallelGCThreadsConstraintFuncParallel to gc/shared after CMS…
Browse files Browse the repository at this point in the history
… removal
  • Loading branch information
kspeeyu committed Jul 20, 2023
1 parent 354c660 commit fe7abef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 24 deletions.
14 changes: 0 additions & 14 deletions src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@
#include "runtime/globals.hpp"
#include "utilities/globalDefinitions.hpp"

JVMFlag::Error ParallelGCThreadsConstraintFuncParallel(uint value, bool verbose) {
// Parallel GC passes ParallelGCThreads when creating GrowableArray as 'int' type parameter.
// So can't exceed with "max_jint"

if (UseParallelGC && (value > (uint)max_jint)) {
JVMFlag::printError(verbose,
"ParallelGCThreads (" UINT32_FORMAT ") must be "
"less than or equal to " UINT32_FORMAT " for Parallel GC\n",
value, max_jint);
return JVMFlag::VIOLATES_CONSTRAINT;
}
return JVMFlag::SUCCESS;
}

JVMFlag::Error InitialTenuringThresholdConstraintFuncParallel(uint value, bool verbose) {
// InitialTenuringThreshold is only used for ParallelGC.
if (UseParallelGC && (value > MaxTenuringThreshold)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

// Parallel Subconstraints
#define PARALLEL_GC_CONSTRAINTS(f) \
f(uint, ParallelGCThreadsConstraintFuncParallel) \
f(uint, InitialTenuringThresholdConstraintFuncParallel) \
f(uint, MaxTenuringThresholdConstraintFuncParallel)

Expand Down
19 changes: 10 additions & 9 deletions src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,19 @@
// checking functions, FLAG_IS_CMDLINE() is used to check if
// the flag has been set by the user and so should be checked.

// As ParallelGCThreads differs among GC modes, we need constraint function.
// (earlier ParallelGCThreadConstraintsFuncParallel) replaced after CMS is removed
JVMFlag::Error ParallelGCThreadsConstraintFunc(uint value, bool verbose) {
JVMFlag::Error status = JVMFlag::SUCCESS;
// Parallel GC passes ParallelGCThreads when creating GrowableArray as 'int' type parameter.
// So can't exceed with "max_jint"

#if INCLUDE_PARALLELGC
status = ParallelGCThreadsConstraintFuncParallel(value, verbose);
if (status != JVMFlag::SUCCESS) {
return status;
if (UseParallelGC && (value > (uint)max_jint)) {
JVMFlag::printError(verbose,
"ParallelGCThreads (" UINT32_FORMAT ") must be "
"less than or equal to " UINT32_FORMAT " for Parallel GC\n",
value, max_jint);
return JVMFlag::VIOLATES_CONSTRAINT;
}
#endif

return status;
return JVMFlag::SUCCESS;
}

static JVMFlag::Error MinPLABSizeBounds(const char* name, size_t value, bool verbose) {
Expand Down

0 comments on commit fe7abef

Please sign in to comment.