8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments
authorgziemski
Tue, 29 May 2018 11:04:56 -0500
changeset 50289 0195ee80e530
parent 50288 3831655869bc
child 50290 b4fc0f620f7f
8133564: Runtime - 2nd followup to Validate JVM Command-Line Flag Arguments Summary: Moved print function into JVMFlag, cleaned up include headers. Reviewed-by: coleenp, hseigel
src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp
src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp
src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp
src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp
src/hotspot/share/runtime/flags/jvmFlag.cpp
src/hotspot/share/runtime/flags/jvmFlag.hpp
src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp
src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp
src/hotspot/share/runtime/flags/jvmFlagRangeList.hpp
src/hotspot/share/runtime/globals.cpp
--- a/src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp	Tue May 29 11:04:56 2018 -0500
@@ -30,17 +30,16 @@
 #include "gc/shared/genCollectedHeap.hpp"
 #include "gc/shared/jvmFlagConstraintsGC.hpp"
 #include "memory/universe.hpp"
-#include "runtime/flags/jvmFlagRangeList.hpp"
 #include "runtime/globals_extension.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 static JVMFlag::Error ParallelGCThreadsAndCMSWorkQueueDrainThreshold(uint threads, uintx threshold, bool verbose) {
   // CMSWorkQueueDrainThreshold is verified to be less than max_juint
   if (UseConcMarkSweepGC && (threads > (uint)(max_jint / (uint)threshold))) {
-    CommandLineError::print(verbose,
-                            "ParallelGCThreads (" UINT32_FORMAT ") or CMSWorkQueueDrainThreshold ("
-                            UINTX_FORMAT ") is too large\n",
-                            threads, threshold);
+    JVMFlag::printError(verbose,
+                        "ParallelGCThreads (" UINT32_FORMAT ") or CMSWorkQueueDrainThreshold ("
+                        UINTX_FORMAT ") is too large\n",
+                        threads, threshold);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -49,20 +48,20 @@
 JVMFlag::Error ParallelGCThreadsConstraintFuncCMS(uint value, bool verbose) {
   // To avoid overflow at ParScanClosure::do_oop_work.
   if (UseConcMarkSweepGC && (value > (max_jint / 10))) {
-    CommandLineError::print(verbose,
-                            "ParallelGCThreads (" UINT32_FORMAT ") must be "
-                            "less than or equal to " UINT32_FORMAT " for CMS GC\n",
-                            value, (max_jint / 10));
+    JVMFlag::printError(verbose,
+                        "ParallelGCThreads (" UINT32_FORMAT ") must be "
+                        "less than or equal to " UINT32_FORMAT " for CMS GC\n",
+                        value, (max_jint / 10));
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return ParallelGCThreadsAndCMSWorkQueueDrainThreshold(value, CMSWorkQueueDrainThreshold, verbose);
 }
 JVMFlag::Error ParGCStridesPerThreadConstraintFunc(uintx value, bool verbose) {
   if (UseConcMarkSweepGC && (value > ((uintx)max_jint / (uintx)ParallelGCThreads))) {
-    CommandLineError::print(verbose,
-                            "ParGCStridesPerThread (" UINTX_FORMAT ") must be "
-                            "less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n",
-                            value, ((uintx)max_jint / (uintx)ParallelGCThreads));
+    JVMFlag::printError(verbose,
+                        "ParGCStridesPerThread (" UINTX_FORMAT ") must be "
+                        "less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n",
+                        value, ((uintx)max_jint / (uintx)ParallelGCThreads));
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -76,10 +75,10 @@
     size_t card_table_size = ct->cards_required(heap_size) - 1; // Valid card table size
 
     if ((size_t)value > card_table_size) {
-      CommandLineError::print(verbose,
-                              "ParGCCardsPerStrideChunk (" INTX_FORMAT ") is too large for the heap size and "
-                              "must be less than or equal to card table size (" SIZE_FORMAT ")\n",
-                              value, card_table_size);
+      JVMFlag::printError(verbose,
+                          "ParGCCardsPerStrideChunk (" INTX_FORMAT ") is too large for the heap size and "
+                          "must be less than or equal to card table size (" SIZE_FORMAT ")\n",
+                          value, card_table_size);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
 
@@ -89,10 +88,10 @@
     uintx n_strides = ParallelGCThreads * ParGCStridesPerThread;
     uintx ergo_max = max_uintx / n_strides;
     if ((uintx)value > ergo_max) {
-      CommandLineError::print(verbose,
-                              "ParGCCardsPerStrideChunk (" INTX_FORMAT ") must be "
-                              "less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n",
-                              value, ergo_max);
+      JVMFlag::printError(verbose,
+                          "ParGCCardsPerStrideChunk (" INTX_FORMAT ") must be "
+                          "less than or equal to ergonomic maximum (" UINTX_FORMAT ")\n",
+                          value, ergo_max);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -104,10 +103,10 @@
 
   if (UseConcMarkSweepGC) {
     if (value > CMSOldPLABMax) {
-      CommandLineError::print(verbose,
-                              "CMSOldPLABMin (" SIZE_FORMAT ") must be "
-                              "less than or equal to CMSOldPLABMax (" SIZE_FORMAT ")\n",
-                              value, CMSOldPLABMax);
+      JVMFlag::printError(verbose,
+                          "CMSOldPLABMin (" SIZE_FORMAT ") must be "
+                          "less than or equal to CMSOldPLABMax (" SIZE_FORMAT ")\n",
+                          value, CMSOldPLABMax);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
     status = MaxPLABSizeBounds("CMSOldPLABMin", value, verbose);
@@ -129,11 +128,11 @@
     ConcurrentMarkSweepGeneration* cms = CMSHeap::heap()->old_gen();
     const size_t ergo_max = cms->cmsSpace()->max_flag_size_for_task_size();
     if (value > ergo_max) {
-      CommandLineError::print(verbose,
-                              "%s (" SIZE_FORMAT ") must be "
-                              "less than or equal to ergonomic maximum (" SIZE_FORMAT ") "
-                              "which is based on the maximum size of the old generation of the Java heap\n",
-                              name, value, ergo_max);
+      JVMFlag::printError(verbose,
+                          "%s (" SIZE_FORMAT ") must be "
+                          "less than or equal to ergonomic maximum (" SIZE_FORMAT ") "
+                          "which is based on the maximum size of the old generation of the Java heap\n",
+                          name, value, ergo_max);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -150,10 +149,10 @@
     // Note that rescan_task_size() will be aligned if CMSRescanMultiple is a multiple of 'HeapWordSize'
     // because rescan_task_size() is CardTable::card_size / HeapWordSize * BitsPerWord.
     if (value % HeapWordSize != 0) {
-      CommandLineError::print(verbose,
-                              "CMSRescanMultiple (" SIZE_FORMAT ") must be "
-                              "a multiple of " SIZE_FORMAT "\n",
-                              value, HeapWordSize);
+      JVMFlag::printError(verbose,
+                          "CMSRescanMultiple (" SIZE_FORMAT ") must be "
+                          "a multiple of " SIZE_FORMAT "\n",
+                          value, HeapWordSize);
       status = JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -167,10 +166,10 @@
 
 JVMFlag::Error CMSPrecleanDenominatorConstraintFunc(uintx value, bool verbose) {
   if (UseConcMarkSweepGC && (value <= CMSPrecleanNumerator)) {
-    CommandLineError::print(verbose,
-                            "CMSPrecleanDenominator (" UINTX_FORMAT ") must be "
-                            "strickly greater than CMSPrecleanNumerator (" UINTX_FORMAT ")\n",
-                            value, CMSPrecleanNumerator);
+    JVMFlag::printError(verbose,
+                        "CMSPrecleanDenominator (" UINTX_FORMAT ") must be "
+                        "strickly greater than CMSPrecleanNumerator (" UINTX_FORMAT ")\n",
+                        value, CMSPrecleanNumerator);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -178,10 +177,10 @@
 
 JVMFlag::Error CMSPrecleanNumeratorConstraintFunc(uintx value, bool verbose) {
   if (UseConcMarkSweepGC && (value >= CMSPrecleanDenominator)) {
-    CommandLineError::print(verbose,
-                            "CMSPrecleanNumerator (" UINTX_FORMAT ") must be "
-                            "less than CMSPrecleanDenominator (" UINTX_FORMAT ")\n",
-                            value, CMSPrecleanDenominator);
+    JVMFlag::printError(verbose,
+                        "CMSPrecleanNumerator (" UINTX_FORMAT ") must be "
+                        "less than CMSPrecleanDenominator (" UINTX_FORMAT ")\n",
+                        value, CMSPrecleanDenominator);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -191,10 +190,10 @@
   if (UseConcMarkSweepGC) {
     size_t max_capacity = CMSHeap::heap()->young_gen()->max_capacity();
     if (value > max_uintx - max_capacity) {
-    CommandLineError::print(verbose,
-                            "CMSSamplingGrain (" UINTX_FORMAT ") must be "
-                            "less than or equal to ergonomic maximum (" SIZE_FORMAT ")\n",
-                            value, max_uintx - max_capacity);
+    JVMFlag::printError(verbose,
+                        "CMSSamplingGrain (" UINTX_FORMAT ") must be "
+                        "less than or equal to ergonomic maximum (" SIZE_FORMAT ")\n",
+                        value, max_uintx - max_capacity);
     return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -216,11 +215,11 @@
     size_t bitmap_size = cms->collector()->markBitMap()->sizeInWords();
 
     if (value > bitmap_size) {
-      CommandLineError::print(verbose,
-                              "CMSBitMapYieldQuantum (" SIZE_FORMAT ") must "
-                              "be less than or equal to bitmap size (" SIZE_FORMAT ") "
-                              "whose size corresponds to the size of old generation of the Java heap\n",
-                              value, bitmap_size);
+      JVMFlag::printError(verbose,
+                          "CMSBitMapYieldQuantum (" SIZE_FORMAT ") must "
+                          "be less than or equal to bitmap size (" SIZE_FORMAT ") "
+                          "whose size corresponds to the size of old generation of the Java heap\n",
+                          value, bitmap_size);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -229,9 +228,9 @@
 
 JVMFlag::Error OldPLABSizeConstraintFuncCMS(size_t value, bool verbose) {
   if (value == 0) {
-    CommandLineError::print(verbose,
-                            "OldPLABSize (" SIZE_FORMAT ") must be greater than 0",
-                            value);
+    JVMFlag::printError(verbose,
+                        "OldPLABSize (" SIZE_FORMAT ") must be greater than 0",
+                        value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   // For CMS, OldPLABSize is the number of free blocks of a given size that are used when
--- a/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp	Tue May 29 11:04:56 2018 -0500
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/g1/heapRegionBounds.inline.hpp"
-#include "runtime/flags/jvmFlagRangeList.hpp"
+#include "gc/g1/jvmFlagConstraintsG1.hpp"
 #include "runtime/globals_extension.hpp"
 #include "utilities/globalDefinitions.hpp"
 
@@ -34,10 +34,10 @@
   // Default value of G1RSetRegionEntries=0 means will be set ergonomically.
   // Minimum value is 1.
   if (FLAG_IS_CMDLINE(G1RSetRegionEntries) && (value < 1)) {
-    CommandLineError::print(verbose,
-                            "G1RSetRegionEntries (" INTX_FORMAT ") must be "
-                            "greater than or equal to 1\n",
-                            value);
+    JVMFlag::printError(verbose,
+                        "G1RSetRegionEntries (" INTX_FORMAT ") must be "
+                        "greater than or equal to 1\n",
+                        value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -50,10 +50,10 @@
   // Default value of G1RSetSparseRegionEntries=0 means will be set ergonomically.
   // Minimum value is 1.
   if (FLAG_IS_CMDLINE(G1RSetSparseRegionEntries) && (value < 1)) {
-    CommandLineError::print(verbose,
-                            "G1RSetSparseRegionEntries (" INTX_FORMAT ") must be "
-                            "greater than or equal to 1\n",
-                            value);
+    JVMFlag::printError(verbose,
+                        "G1RSetSparseRegionEntries (" INTX_FORMAT ") must be "
+                        "greater than or equal to 1\n",
+                        value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -65,10 +65,10 @@
 
   // Default value of G1HeapRegionSize=0 means will be set ergonomically.
   if (FLAG_IS_CMDLINE(G1HeapRegionSize) && (value < HeapRegionBounds::min_size())) {
-    CommandLineError::print(verbose,
-                            "G1HeapRegionSize (" SIZE_FORMAT ") must be "
-                            "greater than or equal to ergonomic heap region minimum size\n",
-                            value);
+    JVMFlag::printError(verbose,
+                        "G1HeapRegionSize (" SIZE_FORMAT ") must be "
+                        "greater than or equal to ergonomic heap region minimum size\n",
+                        value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -79,10 +79,10 @@
   if (!UseG1GC) return JVMFlag::SUCCESS;
 
   if (value > G1MaxNewSizePercent) {
-    CommandLineError::print(verbose,
-                            "G1NewSizePercent (" UINTX_FORMAT ") must be "
-                            "less than or equal to G1MaxNewSizePercent (" UINTX_FORMAT ")\n",
-                            value, G1MaxNewSizePercent);
+    JVMFlag::printError(verbose,
+                        "G1NewSizePercent (" UINTX_FORMAT ") must be "
+                        "less than or equal to G1MaxNewSizePercent (" UINTX_FORMAT ")\n",
+                        value, G1MaxNewSizePercent);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -93,10 +93,10 @@
   if (!UseG1GC) return JVMFlag::SUCCESS;
 
   if (value < G1NewSizePercent) {
-    CommandLineError::print(verbose,
-                            "G1MaxNewSizePercent (" UINTX_FORMAT ") must be "
-                            "greater than or equal to G1NewSizePercent (" UINTX_FORMAT ")\n",
-                            value, G1NewSizePercent);
+    JVMFlag::printError(verbose,
+                        "G1MaxNewSizePercent (" UINTX_FORMAT ") must be "
+                        "greater than or equal to G1NewSizePercent (" UINTX_FORMAT ")\n",
+                        value, G1NewSizePercent);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -105,10 +105,10 @@
 
 JVMFlag::Error MaxGCPauseMillisConstraintFuncG1(uintx value, bool verbose) {
   if (UseG1GC && FLAG_IS_CMDLINE(MaxGCPauseMillis) && (value >= GCPauseIntervalMillis)) {
-    CommandLineError::print(verbose,
-                            "MaxGCPauseMillis (" UINTX_FORMAT ") must be "
-                            "less than GCPauseIntervalMillis (" UINTX_FORMAT ")\n",
-                            value, GCPauseIntervalMillis);
+    JVMFlag::printError(verbose,
+                        "MaxGCPauseMillis (" UINTX_FORMAT ") must be "
+                        "less than GCPauseIntervalMillis (" UINTX_FORMAT ")\n",
+                        value, GCPauseIntervalMillis);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -119,25 +119,25 @@
   if (UseG1GC) {
     if (FLAG_IS_CMDLINE(GCPauseIntervalMillis)) {
       if (value < 1) {
-        CommandLineError::print(verbose,
-                                "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
-                                "greater than or equal to 1\n",
-                                value);
+        JVMFlag::printError(verbose,
+                            "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
+                            "greater than or equal to 1\n",
+                            value);
         return JVMFlag::VIOLATES_CONSTRAINT;
       }
 
       if (FLAG_IS_DEFAULT(MaxGCPauseMillis)) {
-        CommandLineError::print(verbose,
-                                "GCPauseIntervalMillis cannot be set "
-                                "without setting MaxGCPauseMillis\n");
+        JVMFlag::printError(verbose,
+                            "GCPauseIntervalMillis cannot be set "
+                            "without setting MaxGCPauseMillis\n");
         return JVMFlag::VIOLATES_CONSTRAINT;
       }
 
       if (value <= MaxGCPauseMillis) {
-        CommandLineError::print(verbose,
-                                "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
-                                "greater than MaxGCPauseMillis (" UINTX_FORMAT ")\n",
-                                value, MaxGCPauseMillis);
+        JVMFlag::printError(verbose,
+                            "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
+                            "greater than MaxGCPauseMillis (" UINTX_FORMAT ")\n",
+                            value, MaxGCPauseMillis);
         return JVMFlag::VIOLATES_CONSTRAINT;
       }
     }
@@ -153,9 +153,9 @@
   // i.e. result of '(uint)(NewSize / region size(1~32MB))'
   // So maximum of NewSize should be 'max_juint * 1M'
   if (UseG1GC && (value > (max_juint * 1 * M))) {
-    CommandLineError::print(verbose,
-                            "NewSize (" SIZE_FORMAT ") must be less than ergonomic maximum value\n",
-                            value);
+    JVMFlag::printError(verbose,
+                        "NewSize (" SIZE_FORMAT ") must be less than ergonomic maximum value\n",
+                        value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 #endif // _LP64
--- a/src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp	Tue May 29 11:04:56 2018 -0500
@@ -23,7 +23,7 @@
  */
 
 #include "precompiled.hpp"
-#include "runtime/flags/jvmFlagRangeList.hpp"
+#include "gc/parallel/jvmFlagConstraintsParallel.hpp"
 #include "runtime/globals.hpp"
 #include "utilities/globalDefinitions.hpp"
 
@@ -32,10 +32,10 @@
   // So can't exceed with "max_jint"
 
   if (UseParallelGC && (value > (uint)max_jint)) {
-    CommandLineError::print(verbose,
-                            "ParallelGCThreads (" UINT32_FORMAT ") must be "
-                            "less than or equal to " UINT32_FORMAT " for Parallel GC\n",
-                            value, 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;
@@ -44,10 +44,10 @@
 JVMFlag::Error InitialTenuringThresholdConstraintFuncParallel(uintx value, bool verbose) {
   // InitialTenuringThreshold is only used for ParallelGC.
   if (UseParallelGC && (value > MaxTenuringThreshold)) {
-      CommandLineError::print(verbose,
-                              "InitialTenuringThreshold (" UINTX_FORMAT ") must be "
-                              "less than or equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n",
-                              value, MaxTenuringThreshold);
+      JVMFlag::printError(verbose,
+                          "InitialTenuringThreshold (" UINTX_FORMAT ") must be "
+                          "less than or equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n",
+                          value, MaxTenuringThreshold);
       return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -57,10 +57,10 @@
   // As only ParallelGC uses InitialTenuringThreshold,
   // we don't need to compare InitialTenuringThreshold with MaxTenuringThreshold.
   if (UseParallelGC && (value < InitialTenuringThreshold)) {
-    CommandLineError::print(verbose,
-                            "MaxTenuringThreshold (" UINTX_FORMAT ") must be "
-                            "greater than or equal to InitialTenuringThreshold (" UINTX_FORMAT ")\n",
-                            value, InitialTenuringThreshold);
+    JVMFlag::printError(verbose,
+                        "MaxTenuringThreshold (" UINTX_FORMAT ") must be "
+                        "greater than or equal to InitialTenuringThreshold (" UINTX_FORMAT ")\n",
+                        value, InitialTenuringThreshold);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
--- a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp	Tue May 29 11:04:56 2018 -0500
@@ -30,12 +30,10 @@
 #include "gc/shared/plab.hpp"
 #include "gc/shared/threadLocalAllocBuffer.hpp"
 #include "runtime/arguments.hpp"
-#include "runtime/flags/jvmFlagRangeList.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/globals_extension.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/align.hpp"
-#include "utilities/defaultStream.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_CMSGC
 #include "gc/cms/jvmFlagConstraintsCMS.hpp"
@@ -88,10 +86,10 @@
   // CMS and G1 GCs use ConcGCThreads.
   if ((GCConfig::is_gc_selected(CollectedHeap::CMS) ||
        GCConfig::is_gc_selected(CollectedHeap::G1)) && (value > ParallelGCThreads)) {
-    CommandLineError::print(verbose,
-                            "ConcGCThreads (" UINT32_FORMAT ") must be "
-                            "less than or equal to ParallelGCThreads (" UINT32_FORMAT ")\n",
-                            value, ParallelGCThreads);
+    JVMFlag::printError(verbose,
+                        "ConcGCThreads (" UINT32_FORMAT ") must be "
+                        "less than or equal to ParallelGCThreads (" UINT32_FORMAT ")\n",
+                        value, ParallelGCThreads);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -102,10 +100,10 @@
   if ((GCConfig::is_gc_selected(CollectedHeap::CMS) ||
        GCConfig::is_gc_selected(CollectedHeap::G1)  ||
        GCConfig::is_gc_selected(CollectedHeap::Parallel)) && (value < PLAB::min_size())) {
-    CommandLineError::print(verbose,
-                            "%s (" SIZE_FORMAT ") must be "
-                            "greater than or equal to ergonomic PLAB minimum size (" SIZE_FORMAT ")\n",
-                            name, value, PLAB::min_size());
+    JVMFlag::printError(verbose,
+                        "%s (" SIZE_FORMAT ") must be "
+                        "greater than or equal to ergonomic PLAB minimum size (" SIZE_FORMAT ")\n",
+                        name, value, PLAB::min_size());
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -116,10 +114,10 @@
   if ((GCConfig::is_gc_selected(CollectedHeap::CMS) ||
        GCConfig::is_gc_selected(CollectedHeap::G1)  ||
        GCConfig::is_gc_selected(CollectedHeap::Parallel)) && (value > PLAB::max_size())) {
-    CommandLineError::print(verbose,
-                            "%s (" SIZE_FORMAT ") must be "
-                            "less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
-                            name, value, PLAB::max_size());
+    JVMFlag::printError(verbose,
+                        "%s (" SIZE_FORMAT ") must be "
+                        "less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
+                        name, value, PLAB::max_size());
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -156,10 +154,10 @@
 
 JVMFlag::Error MinHeapFreeRatioConstraintFunc(uintx value, bool verbose) {
   if (value > MaxHeapFreeRatio) {
-    CommandLineError::print(verbose,
-                            "MinHeapFreeRatio (" UINTX_FORMAT ") must be "
-                            "less than or equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n",
-                            value, MaxHeapFreeRatio);
+    JVMFlag::printError(verbose,
+                        "MinHeapFreeRatio (" UINTX_FORMAT ") must be "
+                        "less than or equal to MaxHeapFreeRatio (" UINTX_FORMAT ")\n",
+                        value, MaxHeapFreeRatio);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -168,10 +166,10 @@
 
 JVMFlag::Error MaxHeapFreeRatioConstraintFunc(uintx value, bool verbose) {
   if (value < MinHeapFreeRatio) {
-    CommandLineError::print(verbose,
-                            "MaxHeapFreeRatio (" UINTX_FORMAT ") must be "
-                            "greater than or equal to MinHeapFreeRatio (" UINTX_FORMAT ")\n",
-                            value, MinHeapFreeRatio);
+    JVMFlag::printError(verbose,
+                        "MaxHeapFreeRatio (" UINTX_FORMAT ") must be "
+                        "greater than or equal to MinHeapFreeRatio (" UINTX_FORMAT ")\n",
+                        value, MinHeapFreeRatio);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -180,11 +178,11 @@
 
 static JVMFlag::Error CheckMaxHeapSizeAndSoftRefLRUPolicyMSPerMB(size_t maxHeap, intx softRef, bool verbose) {
   if ((softRef > 0) && ((maxHeap / M) > (max_uintx / softRef))) {
-    CommandLineError::print(verbose,
-                            "Desired lifetime of SoftReferences cannot be expressed correctly. "
-                            "MaxHeapSize (" SIZE_FORMAT ") or SoftRefLRUPolicyMSPerMB "
-                            "(" INTX_FORMAT ") is too large\n",
-                            maxHeap, softRef);
+    JVMFlag::printError(verbose,
+                        "Desired lifetime of SoftReferences cannot be expressed correctly. "
+                        "MaxHeapSize (" SIZE_FORMAT ") or SoftRefLRUPolicyMSPerMB "
+                        "(" INTX_FORMAT ") is too large\n",
+                        maxHeap, softRef);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -197,10 +195,10 @@
 
 JVMFlag::Error MarkStackSizeConstraintFunc(size_t value, bool verbose) {
   if (value > MarkStackSizeMax) {
-    CommandLineError::print(verbose,
-                            "MarkStackSize (" SIZE_FORMAT ") must be "
-                            "less than or equal to MarkStackSizeMax (" SIZE_FORMAT ")\n",
-                            value, MarkStackSizeMax);
+    JVMFlag::printError(verbose,
+                        "MarkStackSize (" SIZE_FORMAT ") must be "
+                        "less than or equal to MarkStackSizeMax (" SIZE_FORMAT ")\n",
+                        value, MarkStackSizeMax);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -209,10 +207,10 @@
 
 JVMFlag::Error MinMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose) {
   if (value > MaxMetaspaceFreeRatio) {
-    CommandLineError::print(verbose,
-                            "MinMetaspaceFreeRatio (" UINTX_FORMAT ") must be "
-                            "less than or equal to MaxMetaspaceFreeRatio (" UINTX_FORMAT ")\n",
-                            value, MaxMetaspaceFreeRatio);
+    JVMFlag::printError(verbose,
+                        "MinMetaspaceFreeRatio (" UINTX_FORMAT ") must be "
+                        "less than or equal to MaxMetaspaceFreeRatio (" UINTX_FORMAT ")\n",
+                        value, MaxMetaspaceFreeRatio);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -221,10 +219,10 @@
 
 JVMFlag::Error MaxMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose) {
   if (value < MinMetaspaceFreeRatio) {
-    CommandLineError::print(verbose,
-                            "MaxMetaspaceFreeRatio (" UINTX_FORMAT ") must be "
-                            "greater than or equal to MinMetaspaceFreeRatio (" UINTX_FORMAT ")\n",
-                            value, MinMetaspaceFreeRatio);
+    JVMFlag::printError(verbose,
+                        "MaxMetaspaceFreeRatio (" UINTX_FORMAT ") must be "
+                        "greater than or equal to MinMetaspaceFreeRatio (" UINTX_FORMAT ")\n",
+                        value, MinMetaspaceFreeRatio);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -252,12 +250,12 @@
 
   // MaxTenuringThreshold=0 means NeverTenure=false && AlwaysTenure=true
   if ((value == 0) && (NeverTenure || !AlwaysTenure)) {
-    CommandLineError::print(verbose,
-                            "MaxTenuringThreshold (0) should match to NeverTenure=false "
-                            "&& AlwaysTenure=true. But we have NeverTenure=%s "
-                            "AlwaysTenure=%s\n",
-                            NeverTenure ? "true" : "false",
-                            AlwaysTenure ? "true" : "false");
+    JVMFlag::printError(verbose,
+                        "MaxTenuringThreshold (0) should match to NeverTenure=false "
+                        "&& AlwaysTenure=true. But we have NeverTenure=%s "
+                        "AlwaysTenure=%s\n",
+                        NeverTenure ? "true" : "false",
+                        AlwaysTenure ? "true" : "false");
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -288,10 +286,10 @@
 JVMFlag::Error InitialBootClassLoaderMetaspaceSizeConstraintFunc(size_t value, bool verbose) {
   size_t aligned_max = align_down(max_uintx/2, Metaspace::reserve_alignment_words());
   if (value > aligned_max) {
-    CommandLineError::print(verbose,
-                            "InitialBootClassLoaderMetaspaceSize (" SIZE_FORMAT ") must be "
-                            "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
-                            value, aligned_max);
+    JVMFlag::printError(verbose,
+                        "InitialBootClassLoaderMetaspaceSize (" SIZE_FORMAT ") must be "
+                        "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
+                        value, aligned_max);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -301,10 +299,10 @@
 static JVMFlag::Error MaxSizeForAlignment(const char* name, size_t value, size_t alignment, bool verbose) {
   size_t aligned_max = ((max_uintx - alignment) & ~(alignment-1));
   if (value > aligned_max) {
-    CommandLineError::print(verbose,
-                            "%s (" SIZE_FORMAT ") must be "
-                            "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
-                            name, value, aligned_max);
+    JVMFlag::printError(verbose,
+                        "%s (" SIZE_FORMAT ") must be "
+                        "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
+                        name, value, aligned_max);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -343,10 +341,10 @@
   // If an overflow happened in Arguments::set_heap_size(), MaxHeapSize will have too large a value.
   // Check for this by ensuring that MaxHeapSize plus the requested min base address still fit within max_uintx.
   if (UseCompressedOops && FLAG_IS_ERGO(MaxHeapSize) && (value > (max_uintx - MaxHeapSize))) {
-    CommandLineError::print(verbose,
-                            "HeapBaseMinAddress (" SIZE_FORMAT ") or MaxHeapSize (" SIZE_FORMAT ") is too large. "
-                            "Sum of them must be less than or equal to maximum of size_t (" SIZE_FORMAT ")\n",
-                            value, MaxHeapSize, max_uintx);
+    JVMFlag::printError(verbose,
+                        "HeapBaseMinAddress (" SIZE_FORMAT ") or MaxHeapSize (" SIZE_FORMAT ") is too large. "
+                        "Sum of them must be less than or equal to maximum of size_t (" SIZE_FORMAT ")\n",
+                        value, MaxHeapSize, max_uintx);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -367,17 +365,17 @@
 JVMFlag::Error MinTLABSizeConstraintFunc(size_t value, bool verbose) {
   // At least, alignment reserve area is needed.
   if (value < ThreadLocalAllocBuffer::alignment_reserve_in_bytes()) {
-    CommandLineError::print(verbose,
-                            "MinTLABSize (" SIZE_FORMAT ") must be "
-                            "greater than or equal to reserved area in TLAB (" SIZE_FORMAT ")\n",
-                            value, ThreadLocalAllocBuffer::alignment_reserve_in_bytes());
+    JVMFlag::printError(verbose,
+                        "MinTLABSize (" SIZE_FORMAT ") must be "
+                        "greater than or equal to reserved area in TLAB (" SIZE_FORMAT ")\n",
+                        value, ThreadLocalAllocBuffer::alignment_reserve_in_bytes());
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) {
-    CommandLineError::print(verbose,
-                            "MinTLABSize (" SIZE_FORMAT ") must be "
-                            "less than or equal to ergonomic TLAB maximum (" SIZE_FORMAT ")\n",
-                            value, ThreadLocalAllocBuffer::max_size() * HeapWordSize);
+    JVMFlag::printError(verbose,
+                        "MinTLABSize (" SIZE_FORMAT ") must be "
+                        "less than or equal to ergonomic TLAB maximum (" SIZE_FORMAT ")\n",
+                        value, ThreadLocalAllocBuffer::max_size() * HeapWordSize);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -387,17 +385,17 @@
   // Skip for default value of zero which means set ergonomically.
   if (FLAG_IS_CMDLINE(TLABSize)) {
     if (value < MinTLABSize) {
-      CommandLineError::print(verbose,
-                              "TLABSize (" SIZE_FORMAT ") must be "
-                              "greater than or equal to MinTLABSize (" SIZE_FORMAT ")\n",
-                              value, MinTLABSize);
+      JVMFlag::printError(verbose,
+                          "TLABSize (" SIZE_FORMAT ") must be "
+                          "greater than or equal to MinTLABSize (" SIZE_FORMAT ")\n",
+                          value, MinTLABSize);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
     if (value > (ThreadLocalAllocBuffer::max_size() * HeapWordSize)) {
-      CommandLineError::print(verbose,
-                              "TLABSize (" SIZE_FORMAT ") must be "
-                              "less than or equal to ergonomic TLAB maximum size (" SIZE_FORMAT ")\n",
-                              value, (ThreadLocalAllocBuffer::max_size() * HeapWordSize));
+      JVMFlag::printError(verbose,
+                          "TLABSize (" SIZE_FORMAT ") must be "
+                          "less than or equal to ergonomic TLAB maximum size (" SIZE_FORMAT ")\n",
+                          value, (ThreadLocalAllocBuffer::max_size() * HeapWordSize));
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -412,10 +410,10 @@
 
     // Compare with 'max_uintx' as ThreadLocalAllocBuffer::_refill_waste_limit is 'size_t'.
     if (refill_waste_limit > (max_uintx - value)) {
-      CommandLineError::print(verbose,
-                              "TLABWasteIncrement (" UINTX_FORMAT ") must be "
-                              "less than or equal to ergonomic TLAB waste increment maximum size(" SIZE_FORMAT ")\n",
-                              value, (max_uintx - refill_waste_limit));
+      JVMFlag::printError(verbose,
+                          "TLABWasteIncrement (" UINTX_FORMAT ") must be "
+                          "less than or equal to ergonomic TLAB waste increment maximum size(" SIZE_FORMAT ")\n",
+                          value, (max_uintx - refill_waste_limit));
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -425,11 +423,11 @@
 JVMFlag::Error SurvivorRatioConstraintFunc(uintx value, bool verbose) {
   if (FLAG_IS_CMDLINE(SurvivorRatio) &&
       (value > (MaxHeapSize / Universe::heap()->collector_policy()->space_alignment()))) {
-    CommandLineError::print(verbose,
-                            "SurvivorRatio (" UINTX_FORMAT ") must be "
-                            "less than or equal to ergonomic SurvivorRatio maximum (" SIZE_FORMAT ")\n",
-                            value,
-                            (MaxHeapSize / Universe::heap()->collector_policy()->space_alignment()));
+    JVMFlag::printError(verbose,
+                        "SurvivorRatio (" UINTX_FORMAT ") must be "
+                        "less than or equal to ergonomic SurvivorRatio maximum (" SIZE_FORMAT ")\n",
+                        value,
+                        (MaxHeapSize / Universe::heap()->collector_policy()->space_alignment()));
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -438,10 +436,10 @@
 
 JVMFlag::Error MetaspaceSizeConstraintFunc(size_t value, bool verbose) {
   if (value > MaxMetaspaceSize) {
-    CommandLineError::print(verbose,
-                            "MetaspaceSize (" SIZE_FORMAT ") must be "
-                            "less than or equal to MaxMetaspaceSize (" SIZE_FORMAT ")\n",
-                            value, MaxMetaspaceSize);
+    JVMFlag::printError(verbose,
+                        "MetaspaceSize (" SIZE_FORMAT ") must be "
+                        "less than or equal to MaxMetaspaceSize (" SIZE_FORMAT ")\n",
+                        value, MaxMetaspaceSize);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -450,10 +448,10 @@
 
 JVMFlag::Error MaxMetaspaceSizeConstraintFunc(size_t value, bool verbose) {
   if (value < MetaspaceSize) {
-    CommandLineError::print(verbose,
-                            "MaxMetaspaceSize (" SIZE_FORMAT ") must be "
-                            "greater than or equal to MetaspaceSize (" SIZE_FORMAT ")\n",
-                            value, MaxMetaspaceSize);
+    JVMFlag::printError(verbose,
+                        "MaxMetaspaceSize (" SIZE_FORMAT ") must be "
+                        "greater than or equal to MetaspaceSize (" SIZE_FORMAT ")\n",
+                        value, MaxMetaspaceSize);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -463,17 +461,17 @@
 JVMFlag::Error SurvivorAlignmentInBytesConstraintFunc(intx value, bool verbose) {
   if (value != 0) {
     if (!is_power_of_2(value)) {
-      CommandLineError::print(verbose,
-                              "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be "
-                              "power of 2\n",
-                              value);
+      JVMFlag::printError(verbose,
+                          "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be "
+                          "power of 2\n",
+                          value);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
     if (value < ObjectAlignmentInBytes) {
-      CommandLineError::print(verbose,
-                              "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be "
-                              "greater than or equal to ObjectAlignmentInBytes (" INTX_FORMAT ")\n",
-                              value, ObjectAlignmentInBytes);
+      JVMFlag::printError(verbose,
+                          "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be "
+                          "greater than or equal to ObjectAlignmentInBytes (" INTX_FORMAT ")\n",
+                          value, ObjectAlignmentInBytes);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
--- a/src/hotspot/share/runtime/flags/jvmFlag.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlag.cpp	Tue May 29 11:04:56 2018 -0500
@@ -1504,3 +1504,12 @@
   FREE_C_HEAP_ARRAY(JVMFlag*, array);
 }
 
+void JVMFlag::printError(bool verbose, const char* msg, ...) {
+  if (verbose) {
+    va_list listPointer;
+    va_start(listPointer, msg);
+    jio_vfprintf(defaultStream::error_stream(), msg, listPointer);
+    va_end(listPointer);
+  }
+}
+
--- a/src/hotspot/share/runtime/flags/jvmFlag.hpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlag.hpp	Tue May 29 11:04:56 2018 -0500
@@ -276,6 +276,7 @@
 
   // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
   static void printFlags(outputStream* out, bool withComments, bool printRanges = false, bool skipDefaults = false);
+  void printError(bool verbose, const char* msg, ...);
 
   static void verify() PRODUCT_RETURN;
 };
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp	Tue May 29 11:04:56 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,17 +31,15 @@
 #include "runtime/arguments.hpp"
 #include "runtime/flags/jvmFlag.hpp"
 #include "runtime/flags/jvmFlagConstraintsCompiler.hpp"
-#include "runtime/flags/jvmFlagRangeList.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/globals_extension.hpp"
-#include "utilities/defaultStream.hpp"
 
 JVMFlag::Error AliasLevelConstraintFunc(intx value, bool verbose) {
   if ((value <= 1) && (Arguments::mode() == Arguments::_comp || Arguments::mode() == Arguments::_mixed)) {
-    CommandLineError::print(verbose,
-                            "AliasLevel (" INTX_FORMAT ") is not "
-                            "compatible with -Xcomp or -Xmixed\n",
-                            value);
+    JVMFlag::printError(verbose,
+                        "AliasLevel (" INTX_FORMAT ") is not "
+                        "compatible with -Xcomp or -Xmixed\n",
+                        value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -82,10 +80,10 @@
   min_number_of_compiler_threads = MIN2(min_number_of_compiler_threads, CI_COMPILER_COUNT);
 
   if (value < (intx)min_number_of_compiler_threads) {
-    CommandLineError::print(verbose,
-                            "CICompilerCount (" INTX_FORMAT ") must be "
-                            "at least %d \n",
-                            value, min_number_of_compiler_threads);
+    JVMFlag::printError(verbose,
+                        "CICompilerCount (" INTX_FORMAT ") must be "
+                        "at least %d \n",
+                        value, min_number_of_compiler_threads);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -94,10 +92,10 @@
 
 JVMFlag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose) {
   if (value < 0 || value > 512) {
-    CommandLineError::print(verbose,
-                            "AllocatePrefetchDistance (" INTX_FORMAT ") must be "
-                            "between 0 and " INTX_FORMAT "\n",
-                            AllocatePrefetchDistance, 512);
+    JVMFlag::printError(verbose,
+                        "AllocatePrefetchDistance (" INTX_FORMAT ") must be "
+                        "between 0 and " INTX_FORMAT "\n",
+                        AllocatePrefetchDistance, 512);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -107,9 +105,9 @@
 JVMFlag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) {
   if (AllocatePrefetchStyle == 3) {
     if (value % wordSize != 0) {
-      CommandLineError::print(verbose,
-                              "AllocatePrefetchStepSize (" INTX_FORMAT ") must be multiple of %d\n",
-                              value, wordSize);
+      JVMFlag::printError(verbose,
+                          "AllocatePrefetchStepSize (" INTX_FORMAT ") must be multiple of %d\n",
+                          value, wordSize);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -124,9 +122,9 @@
   max_value = 3;
 #endif
   if (value < 0 || value > max_value) {
-    CommandLineError::print(verbose,
-                            "AllocatePrefetchInstr (" INTX_FORMAT ") must be "
-                            "between 0 and " INTX_FORMAT "\n", value, max_value);
+    JVMFlag::printError(verbose,
+                        "AllocatePrefetchInstr (" INTX_FORMAT ") must be "
+                        "between 0 and " INTX_FORMAT "\n", value, max_value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -135,11 +133,11 @@
 
 JVMFlag::Error CompileThresholdConstraintFunc(intx value, bool verbose) {
   if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) {
-    CommandLineError::print(verbose,
-                            "CompileThreshold (" INTX_FORMAT ") "
-                            "must be between 0 and %d\n",
-                            value,
-                            INT_MAX >> InvocationCounter::count_shift);
+    JVMFlag::printError(verbose,
+                        "CompileThreshold (" INTX_FORMAT ") "
+                        "must be between 0 and %d\n",
+                        value,
+                        INT_MAX >> InvocationCounter::count_shift);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -150,10 +148,10 @@
   int backward_branch_limit;
   if (ProfileInterpreter) {
     if (OnStackReplacePercentage < InterpreterProfilePercentage) {
-      CommandLineError::print(verbose,
-                              "OnStackReplacePercentage (" INTX_FORMAT ") must be "
-                              "larger than InterpreterProfilePercentage (" INTX_FORMAT ")\n",
-                              OnStackReplacePercentage, InterpreterProfilePercentage);
+      JVMFlag::printError(verbose,
+                          "OnStackReplacePercentage (" INTX_FORMAT ") must be "
+                          "larger than InterpreterProfilePercentage (" INTX_FORMAT ")\n",
+                          OnStackReplacePercentage, InterpreterProfilePercentage);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
 
@@ -161,20 +159,20 @@
                             << InvocationCounter::count_shift;
 
     if (backward_branch_limit < 0) {
-      CommandLineError::print(verbose,
-                              "CompileThreshold * (InterpreterProfilePercentage - OnStackReplacePercentage) / 100 = "
-                              INTX_FORMAT " "
-                              "must be between 0 and " INTX_FORMAT ", try changing "
-                              "CompileThreshold, InterpreterProfilePercentage, and/or OnStackReplacePercentage\n",
-                              (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100,
-                              INT_MAX >> InvocationCounter::count_shift);
+      JVMFlag::printError(verbose,
+                          "CompileThreshold * (InterpreterProfilePercentage - OnStackReplacePercentage) / 100 = "
+                          INTX_FORMAT " "
+                          "must be between 0 and " INTX_FORMAT ", try changing "
+                          "CompileThreshold, InterpreterProfilePercentage, and/or OnStackReplacePercentage\n",
+                          (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100,
+                          INT_MAX >> InvocationCounter::count_shift);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   } else {
     if (OnStackReplacePercentage < 0 ) {
-      CommandLineError::print(verbose,
-                              "OnStackReplacePercentage (" INTX_FORMAT ") must be "
-                              "non-negative\n", OnStackReplacePercentage);
+      JVMFlag::printError(verbose,
+                          "OnStackReplacePercentage (" INTX_FORMAT ") must be "
+                          "non-negative\n", OnStackReplacePercentage);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
 
@@ -182,12 +180,12 @@
                             << InvocationCounter::count_shift;
 
     if (backward_branch_limit < 0) {
-      CommandLineError::print(verbose,
-                              "CompileThreshold * OnStackReplacePercentage / 100 = " INTX_FORMAT " "
-                              "must be between 0 and " INTX_FORMAT ", try changing "
-                              "CompileThreshold and/or OnStackReplacePercentage\n",
-                              (CompileThreshold * OnStackReplacePercentage) / 100,
-                              INT_MAX >> InvocationCounter::count_shift);
+      JVMFlag::printError(verbose,
+                          "CompileThreshold * OnStackReplacePercentage / 100 = " INTX_FORMAT " "
+                          "must be between 0 and " INTX_FORMAT ", try changing "
+                          "CompileThreshold and/or OnStackReplacePercentage\n",
+                          (CompileThreshold * OnStackReplacePercentage) / 100,
+                          INT_MAX >> InvocationCounter::count_shift);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
@@ -196,29 +194,29 @@
 
 JVMFlag::Error CodeCacheSegmentSizeConstraintFunc(uintx value, bool verbose) {
   if (CodeCacheSegmentSize < (uintx)CodeEntryAlignment) {
-    CommandLineError::print(verbose,
-                            "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
-                            "larger than or equal to CodeEntryAlignment (" INTX_FORMAT ") "
-                            "to align entry points\n",
-                            CodeCacheSegmentSize, CodeEntryAlignment);
+    JVMFlag::printError(verbose,
+                        "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
+                        "larger than or equal to CodeEntryAlignment (" INTX_FORMAT ") "
+                        "to align entry points\n",
+                        CodeCacheSegmentSize, CodeEntryAlignment);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
   if (CodeCacheSegmentSize < sizeof(jdouble)) {
-    CommandLineError::print(verbose,
-                            "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
-                            "at least " SIZE_FORMAT " to align constants\n",
-                            CodeCacheSegmentSize, sizeof(jdouble));
+    JVMFlag::printError(verbose,
+                        "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
+                        "at least " SIZE_FORMAT " to align constants\n",
+                        CodeCacheSegmentSize, sizeof(jdouble));
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
 #ifdef COMPILER2
   if (CodeCacheSegmentSize < (uintx)OptoLoopAlignment) {
-    CommandLineError::print(verbose,
-                            "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
-                            "larger than or equal to OptoLoopAlignment (" INTX_FORMAT ") "
-                            "to align inner loops\n",
-                            CodeCacheSegmentSize, OptoLoopAlignment);
+    JVMFlag::printError(verbose,
+                        "CodeCacheSegmentSize  (" UINTX_FORMAT ") must be "
+                        "larger than or equal to OptoLoopAlignment (" INTX_FORMAT ") "
+                        "to align inner loops\n",
+                        CodeCacheSegmentSize, OptoLoopAlignment);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 #endif
@@ -230,11 +228,11 @@
 #ifdef SOLARIS
   if ((value < MinimumPriority || value > MaximumPriority) &&
       (value != -1) && (value != -FXCriticalPriority)) {
-    CommandLineError::print(verbose,
-                            "CompileThreadPriority (" INTX_FORMAT ") must be "
-                            "between %d and %d inclusively or -1 (means no change) "
-                            "or %d (special value for critical thread class/priority)\n",
-                            value, MinimumPriority, MaximumPriority, -FXCriticalPriority);
+    JVMFlag::printError(verbose,
+                        "CompileThreadPriority (" INTX_FORMAT ") must be "
+                        "between %d and %d inclusively or -1 (means no change) "
+                        "or %d (special value for critical thread class/priority)\n",
+                        value, MinimumPriority, MaximumPriority, -FXCriticalPriority);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 #endif
@@ -245,25 +243,25 @@
 JVMFlag::Error CodeEntryAlignmentConstraintFunc(intx value, bool verbose) {
 #ifdef SPARC
   if (CodeEntryAlignment % relocInfo::addr_unit() != 0) {
-    CommandLineError::print(verbose,
-                            "CodeEntryAlignment (" INTX_FORMAT ") must be "
-                            "multiple of NOP size\n", CodeEntryAlignment);
+    JVMFlag::printError(verbose,
+                        "CodeEntryAlignment (" INTX_FORMAT ") must be "
+                        "multiple of NOP size\n", CodeEntryAlignment);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 #endif
 
   if (!is_power_of_2(value)) {
-    CommandLineError::print(verbose,
-                            "CodeEntryAlignment (" INTX_FORMAT ") must be "
-                            "a power of two\n", CodeEntryAlignment);
+    JVMFlag::printError(verbose,
+                        "CodeEntryAlignment (" INTX_FORMAT ") must be "
+                        "a power of two\n", CodeEntryAlignment);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
   if (CodeEntryAlignment < 16) {
-      CommandLineError::print(verbose,
-                              "CodeEntryAlignment (" INTX_FORMAT ") must be "
-                              "greater than or equal to %d\n",
-                              CodeEntryAlignment, 16);
+      JVMFlag::printError(verbose,
+                          "CodeEntryAlignment (" INTX_FORMAT ") must be "
+                          "greater than or equal to %d\n",
+                          CodeEntryAlignment, 16);
       return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -272,20 +270,20 @@
 
 JVMFlag::Error OptoLoopAlignmentConstraintFunc(intx value, bool verbose) {
   if (!is_power_of_2(value)) {
-    CommandLineError::print(verbose,
-                            "OptoLoopAlignment (" INTX_FORMAT ") "
-                            "must be a power of two\n",
-                            value);
+    JVMFlag::printError(verbose,
+                        "OptoLoopAlignment (" INTX_FORMAT ") "
+                        "must be a power of two\n",
+                        value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
   // Relevant on ppc, s390, sparc. Will be optimized where
   // addr_unit() == 1.
   if (OptoLoopAlignment % relocInfo::addr_unit() != 0) {
-    CommandLineError::print(verbose,
-                            "OptoLoopAlignment (" INTX_FORMAT ") must be "
-                            "multiple of NOP size (%d)\n",
-                            value, relocInfo::addr_unit());
+    JVMFlag::printError(verbose,
+                        "OptoLoopAlignment (" INTX_FORMAT ") must be "
+                        "multiple of NOP size (%d)\n",
+                        value, relocInfo::addr_unit());
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -294,9 +292,9 @@
 
 JVMFlag::Error ArraycopyDstPrefetchDistanceConstraintFunc(uintx value, bool verbose) {
   if (value >= 4032) {
-    CommandLineError::print(verbose,
-                            "ArraycopyDstPrefetchDistance (" UINTX_FORMAT ") must be"
-                            "between 0 and 4031\n", value);
+    JVMFlag::printError(verbose,
+                        "ArraycopyDstPrefetchDistance (" UINTX_FORMAT ") must be"
+                        "between 0 and 4031\n", value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -305,9 +303,9 @@
 
 JVMFlag::Error ArraycopySrcPrefetchDistanceConstraintFunc(uintx value, bool verbose) {
   if (value >= 4032) {
-    CommandLineError::print(verbose,
-                            "ArraycopySrcPrefetchDistance (" UINTX_FORMAT ") must be"
-                            "between 0 and 4031\n", value);
+    JVMFlag::printError(verbose,
+                        "ArraycopySrcPrefetchDistance (" UINTX_FORMAT ") must be"
+                        "between 0 and 4031\n", value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -317,9 +315,9 @@
 JVMFlag::Error TypeProfileLevelConstraintFunc(uintx value, bool verbose) {
   for (int i = 0; i < 3; i++) {
     if (value % 10 > 2) {
-      CommandLineError::print(verbose,
-                              "Invalid value (" UINTX_FORMAT ") "
-                              "in TypeProfileLevel at position %d\n", value, i);
+      JVMFlag::printError(verbose,
+                          "Invalid value (" UINTX_FORMAT ") "
+                          "in TypeProfileLevel at position %d\n", value, i);
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
     value = value / 10;
@@ -339,26 +337,26 @@
 #ifdef COMPILER2
 JVMFlag::Error InteriorEntryAlignmentConstraintFunc(intx value, bool verbose) {
   if (InteriorEntryAlignment > CodeEntryAlignment) {
-    CommandLineError::print(verbose,
-                           "InteriorEntryAlignment (" INTX_FORMAT ") must be "
-                           "less than or equal to CodeEntryAlignment (" INTX_FORMAT ")\n",
-                           InteriorEntryAlignment, CodeEntryAlignment);
+    JVMFlag::printError(verbose,
+                       "InteriorEntryAlignment (" INTX_FORMAT ") must be "
+                       "less than or equal to CodeEntryAlignment (" INTX_FORMAT ")\n",
+                       InteriorEntryAlignment, CodeEntryAlignment);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
 #ifdef SPARC
   if (InteriorEntryAlignment % relocInfo::addr_unit() != 0) {
-    CommandLineError::print(verbose,
-                            "InteriorEntryAlignment (" INTX_FORMAT ") must be "
-                            "multiple of NOP size\n");
+    JVMFlag::printError(verbose,
+                        "InteriorEntryAlignment (" INTX_FORMAT ") must be "
+                        "multiple of NOP size\n");
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 #endif
 
   if (!is_power_of_2(value)) {
-     CommandLineError::print(verbose,
-                             "InteriorEntryAlignment (" INTX_FORMAT ") must be "
-                             "a power of two\n", InteriorEntryAlignment);
+     JVMFlag::printError(verbose,
+                         "InteriorEntryAlignment (" INTX_FORMAT ") must be "
+                         "a power of two\n", InteriorEntryAlignment);
      return JVMFlag::VIOLATES_CONSTRAINT;
    }
 
@@ -370,10 +368,10 @@
 #endif
 
   if (InteriorEntryAlignment < minimum_alignment) {
-    CommandLineError::print(verbose,
-                            "InteriorEntryAlignment (" INTX_FORMAT ") must be "
-                            "greater than or equal to %d\n",
-                            InteriorEntryAlignment, minimum_alignment);
+    JVMFlag::printError(verbose,
+                        "InteriorEntryAlignment (" INTX_FORMAT ") must be "
+                        "greater than or equal to %d\n",
+                        InteriorEntryAlignment, minimum_alignment);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -382,10 +380,10 @@
 
 JVMFlag::Error NodeLimitFudgeFactorConstraintFunc(intx value, bool verbose) {
   if (value < MaxNodeLimit * 2 / 100 || value > MaxNodeLimit * 40 / 100) {
-    CommandLineError::print(verbose,
-                            "NodeLimitFudgeFactor must be between 2%% and 40%% "
-                            "of MaxNodeLimit (" INTX_FORMAT ")\n",
-                            MaxNodeLimit);
+    JVMFlag::printError(verbose,
+                        "NodeLimitFudgeFactor must be between 2%% and 40%% "
+                        "of MaxNodeLimit (" INTX_FORMAT ")\n",
+                        MaxNodeLimit);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
@@ -396,10 +394,10 @@
 JVMFlag::Error RTMTotalCountIncrRateConstraintFunc(int value, bool verbose) {
 #if INCLUDE_RTM_OPT
   if (UseRTMLocking && !is_power_of_2(RTMTotalCountIncrRate)) {
-    CommandLineError::print(verbose,
-                            "RTMTotalCountIncrRate (" INTX_FORMAT
-                            ") must be a power of 2, resetting it to 64\n",
-                            RTMTotalCountIncrRate);
+    JVMFlag::printError(verbose,
+                        "RTMTotalCountIncrRate (" INTX_FORMAT
+                        ") must be a power of 2, resetting it to 64\n",
+                        RTMTotalCountIncrRate);
     FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
   }
 #endif
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp	Tue May 29 11:04:56 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,26 +26,24 @@
 #include "runtime/arguments.hpp"
 #include "runtime/flags/jvmFlag.hpp"
 #include "runtime/flags/jvmFlagConstraintsRuntime.hpp"
-#include "runtime/flags/jvmFlagRangeList.hpp"
 #include "runtime/globals.hpp"
 #include "runtime/safepointMechanism.hpp"
 #include "runtime/task.hpp"
-#include "utilities/defaultStream.hpp"
 
 JVMFlag::Error ObjectAlignmentInBytesConstraintFunc(intx value, bool verbose) {
   if (!is_power_of_2(value)) {
-    CommandLineError::print(verbose,
-                            "ObjectAlignmentInBytes (" INTX_FORMAT ") must be "
-                            "power of 2\n",
-                            value);
+    JVMFlag::printError(verbose,
+                        "ObjectAlignmentInBytes (" INTX_FORMAT ") must be "
+                        "power of 2\n",
+                        value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   // In case page size is very small.
   if (value >= (intx)os::vm_page_size()) {
-    CommandLineError::print(verbose,
-                            "ObjectAlignmentInBytes (" INTX_FORMAT ") must be "
-                            "less than page size (" INTX_FORMAT ")\n",
-                            value, (intx)os::vm_page_size());
+    JVMFlag::printError(verbose,
+                        "ObjectAlignmentInBytes (" INTX_FORMAT ") must be "
+                        "less than page size (" INTX_FORMAT ")\n",
+                        value, (intx)os::vm_page_size());
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -55,10 +53,10 @@
 // It is sufficient to check against the largest type size.
 JVMFlag::Error ContendedPaddingWidthConstraintFunc(intx value, bool verbose) {
   if ((value % BytesPerLong) != 0) {
-    CommandLineError::print(verbose,
-                            "ContendedPaddingWidth (" INTX_FORMAT ") must be "
-                            "a multiple of %d\n",
-                            value, BytesPerLong);
+    JVMFlag::printError(verbose,
+                        "ContendedPaddingWidth (" INTX_FORMAT ") must be "
+                        "a multiple of %d\n",
+                        value, BytesPerLong);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -67,10 +65,10 @@
 
 JVMFlag::Error BiasedLockingBulkRebiasThresholdFunc(intx value, bool verbose) {
   if (value > BiasedLockingBulkRevokeThreshold) {
-    CommandLineError::print(verbose,
-                            "BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ") must be "
-                            "less than or equal to BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ")\n",
-                            value, BiasedLockingBulkRevokeThreshold);
+    JVMFlag::printError(verbose,
+                        "BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ") must be "
+                        "less than or equal to BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ")\n",
+                        value, BiasedLockingBulkRevokeThreshold);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -79,10 +77,10 @@
 
 JVMFlag::Error BiasedLockingStartupDelayFunc(intx value, bool verbose) {
   if ((value % PeriodicTask::interval_gran) != 0) {
-    CommandLineError::print(verbose,
-                            "BiasedLockingStartupDelay (" INTX_FORMAT ") must be "
-                            "evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
-                            value, PeriodicTask::interval_gran);
+    JVMFlag::printError(verbose,
+                        "BiasedLockingStartupDelay (" INTX_FORMAT ") must be "
+                        "evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
+                        value, PeriodicTask::interval_gran);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -91,17 +89,17 @@
 
 JVMFlag::Error BiasedLockingBulkRevokeThresholdFunc(intx value, bool verbose) {
   if (value < BiasedLockingBulkRebiasThreshold) {
-    CommandLineError::print(verbose,
-                            "BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ") must be "
-                            "greater than or equal to BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ")\n",
-                            value, BiasedLockingBulkRebiasThreshold);
+    JVMFlag::printError(verbose,
+                        "BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ") must be "
+                        "greater than or equal to BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ")\n",
+                        value, BiasedLockingBulkRebiasThreshold);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else if ((double)value/(double)BiasedLockingDecayTime > 0.1) {
-    CommandLineError::print(verbose,
-                            "The ratio of BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ")"
-                            " to BiasedLockingDecayTime (" INTX_FORMAT ") must be "
-                            "less than or equal to 0.1\n",
-                            value, BiasedLockingBulkRebiasThreshold);
+    JVMFlag::printError(verbose,
+                        "The ratio of BiasedLockingBulkRevokeThreshold (" INTX_FORMAT ")"
+                        " to BiasedLockingDecayTime (" INTX_FORMAT ") must be "
+                        "less than or equal to 0.1\n",
+                        value, BiasedLockingBulkRebiasThreshold);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -110,11 +108,11 @@
 
 JVMFlag::Error BiasedLockingDecayTimeFunc(intx value, bool verbose) {
   if (BiasedLockingBulkRebiasThreshold/(double)value > 0.1) {
-    CommandLineError::print(verbose,
-                            "The ratio of BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ")"
-                            " to BiasedLockingDecayTime (" INTX_FORMAT ") must be "
-                            "less than or equal to 0.1\n",
-                            BiasedLockingBulkRebiasThreshold, value);
+    JVMFlag::printError(verbose,
+                        "The ratio of BiasedLockingBulkRebiasThreshold (" INTX_FORMAT ")"
+                        " to BiasedLockingDecayTime (" INTX_FORMAT ") must be "
+                        "less than or equal to 0.1\n",
+                        BiasedLockingBulkRebiasThreshold, value);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -123,10 +121,10 @@
 
 JVMFlag::Error PerfDataSamplingIntervalFunc(intx value, bool verbose) {
   if ((value % PeriodicTask::interval_gran != 0)) {
-    CommandLineError::print(verbose,
-                            "PerfDataSamplingInterval (" INTX_FORMAT ") must be "
-                            "evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
-                            value, PeriodicTask::interval_gran);
+    JVMFlag::printError(verbose,
+                        "PerfDataSamplingInterval (" INTX_FORMAT ") must be "
+                        "evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
+                        value, PeriodicTask::interval_gran);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
     return JVMFlag::SUCCESS;
@@ -136,7 +134,7 @@
 JVMFlag::Error ThreadLocalHandshakesConstraintFunc(bool value, bool verbose) {
   if (value) {
     if (!SafepointMechanism::supports_thread_local_poll()) {
-      CommandLineError::print(verbose, "ThreadLocalHandshakes not yet supported on this platform\n");
+      JVMFlag::printError(verbose, "ThreadLocalHandshakes not yet supported on this platform\n");
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
--- a/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp	Tue May 29 11:04:56 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,18 +35,8 @@
 #include "runtime/globals_extension.hpp"
 #include "runtime/os.hpp"
 #include "runtime/task.hpp"
-#include "utilities/defaultStream.hpp"
 #include "utilities/macros.hpp"
 
-void CommandLineError::print(bool verbose, const char* msg, ...) {
-  if (verbose) {
-    va_list listPointer;
-    va_start(listPointer, msg);
-    jio_vfprintf(defaultStream::error_stream(), msg, listPointer);
-    va_end(listPointer);
-  }
-}
-
 class JVMFlagRange_int : public JVMFlagRange {
   int _min;
   int _max;
@@ -63,10 +53,10 @@
 
   JVMFlag::Error check_int(int value, bool verbose = true) {
     if ((value < _min) || (value > _max)) {
-      CommandLineError::print(verbose,
-                              "int %s=%d is outside the allowed range "
-                              "[ %d ... %d ]\n",
-                              name(), value, _min, _max);
+      JVMFlag::printError(verbose,
+                          "int %s=%d is outside the allowed range "
+                          "[ %d ... %d ]\n",
+                          name(), value, _min, _max);
       return JVMFlag::OUT_OF_BOUNDS;
     } else {
       return JVMFlag::SUCCESS;
@@ -93,10 +83,10 @@
 
   JVMFlag::Error check_intx(intx value, bool verbose = true) {
     if ((value < _min) || (value > _max)) {
-      CommandLineError::print(verbose,
-                              "intx %s=" INTX_FORMAT " is outside the allowed range "
-                              "[ " INTX_FORMAT " ... " INTX_FORMAT " ]\n",
-                              name(), value, _min, _max);
+      JVMFlag::printError(verbose,
+                          "intx %s=" INTX_FORMAT " is outside the allowed range "
+                          "[ " INTX_FORMAT " ... " INTX_FORMAT " ]\n",
+                          name(), value, _min, _max);
       return JVMFlag::OUT_OF_BOUNDS;
     } else {
       return JVMFlag::SUCCESS;
@@ -124,10 +114,10 @@
 
   JVMFlag::Error check_uint(uint value, bool verbose = true) {
     if ((value < _min) || (value > _max)) {
-      CommandLineError::print(verbose,
-                              "uint %s=%u is outside the allowed range "
-                              "[ %u ... %u ]\n",
-                              name(), value, _min, _max);
+      JVMFlag::printError(verbose,
+                          "uint %s=%u is outside the allowed range "
+                          "[ %u ... %u ]\n",
+                          name(), value, _min, _max);
       return JVMFlag::OUT_OF_BOUNDS;
     } else {
       return JVMFlag::SUCCESS;
@@ -155,10 +145,10 @@
 
   JVMFlag::Error check_uintx(uintx value, bool verbose = true) {
     if ((value < _min) || (value > _max)) {
-      CommandLineError::print(verbose,
-                              "uintx %s=" UINTX_FORMAT " is outside the allowed range "
-                              "[ " UINTX_FORMAT " ... " UINTX_FORMAT " ]\n",
-                              name(), value, _min, _max);
+      JVMFlag::printError(verbose,
+                          "uintx %s=" UINTX_FORMAT " is outside the allowed range "
+                          "[ " UINTX_FORMAT " ... " UINTX_FORMAT " ]\n",
+                          name(), value, _min, _max);
       return JVMFlag::OUT_OF_BOUNDS;
     } else {
       return JVMFlag::SUCCESS;
@@ -186,10 +176,10 @@
 
   JVMFlag::Error check_uint64_t(uint64_t value, bool verbose = true) {
     if ((value < _min) || (value > _max)) {
-      CommandLineError::print(verbose,
-                              "uint64_t %s=" UINT64_FORMAT " is outside the allowed range "
-                              "[ " UINT64_FORMAT " ... " UINT64_FORMAT " ]\n",
-                              name(), value, _min, _max);
+      JVMFlag::printError(verbose,
+                          "uint64_t %s=" UINT64_FORMAT " is outside the allowed range "
+                          "[ " UINT64_FORMAT " ... " UINT64_FORMAT " ]\n",
+                          name(), value, _min, _max);
       return JVMFlag::OUT_OF_BOUNDS;
     } else {
       return JVMFlag::SUCCESS;
@@ -217,10 +207,10 @@
 
   JVMFlag::Error check_size_t(size_t value, bool verbose = true) {
     if ((value < _min) || (value > _max)) {
-      CommandLineError::print(verbose,
-                              "size_t %s=" SIZE_FORMAT " is outside the allowed range "
-                              "[ " SIZE_FORMAT " ... " SIZE_FORMAT " ]\n",
-                              name(), value, _min, _max);
+      JVMFlag::printError(verbose,
+                          "size_t %s=" SIZE_FORMAT " is outside the allowed range "
+                          "[ " SIZE_FORMAT " ... " SIZE_FORMAT " ]\n",
+                          name(), value, _min, _max);
       return JVMFlag::OUT_OF_BOUNDS;
     } else {
       return JVMFlag::SUCCESS;
@@ -248,10 +238,10 @@
 
   JVMFlag::Error check_double(double value, bool verbose = true) {
     if ((value < _min) || (value > _max)) {
-      CommandLineError::print(verbose,
-                              "double %s=%f is outside the allowed range "
-                              "[ %f ... %f ]\n",
-                              name(), value, _min, _max);
+      JVMFlag::printError(verbose,
+                          "double %s=%f is outside the allowed range "
+                          "[ %f ... %f ]\n",
+                          name(), value, _min, _max);
       return JVMFlag::OUT_OF_BOUNDS;
     } else {
       return JVMFlag::SUCCESS;
@@ -432,7 +422,6 @@
 }
 
 bool JVMFlagRangeList::check_ranges() {
-  // Check ranges.
   bool status = true;
   for (int i=0; i<length(); i++) {
     JVMFlagRange* range = at(i);
--- a/src/hotspot/share/runtime/flags/jvmFlagRangeList.hpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlagRangeList.hpp	Tue May 29 11:04:56 2018 -0500
@@ -39,11 +39,6 @@
  * then we need to use constraint instead.
  */
 
-class CommandLineError : public AllStatic {
-public:
-  static void print(bool verbose, const char* msg, ...);
-};
-
 class JVMFlagRange : public CHeapObj<mtArguments> {
 private:
   const char* _name;
--- a/src/hotspot/share/runtime/globals.cpp	Tue May 29 13:44:44 2018 +0200
+++ b/src/hotspot/share/runtime/globals.cpp	Tue May 29 11:04:56 2018 -0500
@@ -32,7 +32,6 @@
 #include "runtime/globals_extension.hpp"
 #include "runtime/flags/jvmFlagConstraintList.hpp"
 #include "runtime/flags/jvmFlagWriteableList.hpp"
-#include "runtime/flags/jvmFlagRangeList.hpp"
 #include "runtime/os.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "utilities/defaultStream.hpp"