Use proper flag aliasing machinery. Avoid setting immutable develop flags in release builds.
--- a/src/hotspot/share/gc/epsilon/epsilonArguments.cpp Thu Jan 18 12:08:41 2018 +0100
+++ b/src/hotspot/share/gc/epsilon/epsilonArguments.cpp Fri Jan 19 12:24:15 2018 +0100
@@ -38,14 +38,7 @@
void EpsilonArguments::initialize_flags() {
GCArguments::initialize_flags();
- assert(UseEpsilonGC || UseNoGC, "Error");
-
- // UseNoGC is the alias, drop and replace it with the a single option:
- // the rest of the code can use UseEpsilonGC then.
- if (UseNoGC) {
- FLAG_SET_DEFAULT(UseEpsilonGC, true);
- FLAG_SET_DEFAULT(UseNoGC, false);
- }
+ assert(UseEpsilonGC, "Error");
// Forcefully exit when OOME is detected. Nothing we can do at that point.
if (FLAG_IS_DEFAULT(ExitOnOutOfMemoryError)) {
--- a/src/hotspot/share/gc/shared/gcArguments.cpp Thu Jan 18 12:08:41 2018 +0100
+++ b/src/hotspot/share/gc/shared/gcArguments.cpp Fri Jan 19 12:24:15 2018 +0100
@@ -55,7 +55,7 @@
bool GCArguments::gc_selected() {
#if INCLUDE_ALL_GCS
- return UseSerialGC || UseParallelGC || UseParallelOldGC || UseConcMarkSweepGC || UseG1GC || (UseEpsilonGC || UseNoGC);
+ return UseSerialGC || UseParallelGC || UseParallelOldGC || UseConcMarkSweepGC || UseG1GC || UseEpsilonGC;
#else
return UseSerialGC;
#endif // INCLUDE_ALL_GCS
@@ -147,7 +147,7 @@
_instance = new G1Arguments();
} else if (UseConcMarkSweepGC) {
_instance = new CMSArguments();
- } else if (UseEpsilonGC || UseNoGC) {
+ } else if (UseEpsilonGC) {
_instance = new EpsilonArguments();
#endif
} else if (UseSerialGC) {
--- a/src/hotspot/share/runtime/arguments.cpp Thu Jan 18 12:08:41 2018 +0100
+++ b/src/hotspot/share/runtime/arguments.cpp Fri Jan 19 12:24:15 2018 +0100
@@ -552,6 +552,7 @@
static AliasedFlag const aliased_jvm_flags[] = {
{ "DefaultMaxRAMFraction", "MaxRAMFraction" },
{ "CreateMinidumpOnCrash", "CreateCoredumpOnCrash" },
+ { "UseNoGC", "UseEpsilonGC" },
{ NULL, NULL}
};
@@ -2192,7 +2193,6 @@
if (UseConcMarkSweepGC) i++;
if (UseParallelGC || UseParallelOldGC) i++;
if (UseG1GC) i++;
- if (UseNoGC) i++;
if (UseEpsilonGC) i++;
if (i > 1) {
jio_fprintf(defaultStream::error_stream(),
--- a/src/hotspot/share/runtime/globals.hpp Thu Jan 18 12:08:41 2018 +0100
+++ b/src/hotspot/share/runtime/globals.hpp Fri Jan 19 12:24:15 2018 +0100
@@ -1422,9 +1422,6 @@
develop(bool, UseEpsilonGC, false, \
"Use the Epsilon (no-op) garbage collector") \
\
- develop(bool, UseNoGC, false, \
- "Use the Epsilon (no-op) garbage collector") \
- \
product(uintx, HeapMaximumCompactionInterval, 20, \
"How often should we maximally compact the heap (not allowing " \
"any dead space)") \