changeset 10287:a4dc32b7640d

8146187: Print develop and nonproduct flags by -XX:+PrintFlags* options in debug build Reviewed-by: gtriantafill, gziemski, dholmes
author ddmitriev
date Fri, 19 Feb 2016 13:24:21 +0300
parents 8c94907406e1
children a10b72550e25
files src/share/vm/runtime/globals.cpp test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java
diffstat 2 files changed, 10 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/globals.cpp	Wed Feb 17 18:02:03 2016 -0500
+++ b/src/share/vm/runtime/globals.cpp	Fri Feb 19 13:24:21 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, 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
@@ -403,25 +403,20 @@
     st->cr();
 
   } else if (!is_bool() && !is_ccstr()) {
+    st->print("%9s %-50s ", _type, _name);
 
-    if (printRanges) {
+    CommandLineFlagRangeList::print(_name, st, true);
 
-      st->print("%9s %-50s ", _type, _name);
-
-      CommandLineFlagRangeList::print(_name, st, true);
-
-      st->print(" %-20s", " ");
-      print_kind(st);
+    st->print(" %-20s", " ");
+    print_kind(st);
 
 #ifndef PRODUCT
-      if (withComments) {
-        st->print("%s", _doc);
-      }
+    if (withComments) {
+      st->print("%s", _doc);
+    }
 #endif
 
-      st->cr();
-
-    }
+    st->cr();
   }
 }
 
@@ -1255,8 +1250,6 @@
 
 #endif // PRODUCT
 
-#define ONLY_PRINT_PRODUCT_FLAGS
-
 void CommandLineFlags::printFlags(outputStream* out, bool withComments, bool printRanges) {
   // Print the flags sorted by name
   // note: this method is called before the thread structure is in place
@@ -1281,9 +1274,6 @@
 
   for (size_t i = 0; i < length; i++) {
     if (array[i]->is_unlocked()) {
-#ifdef ONLY_PRINT_PRODUCT_FLAGS
-      if (!array[i]->is_notproduct() && !array[i]->is_develop())
-#endif // ONLY_PRINT_PRODUCT_FLAGS
       array[i]->print_on(out, withComments, printRanges);
     }
   }
--- a/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java	Wed Feb 17 18:02:03 2016 -0500
+++ b/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java	Fri Feb 19 13:24:21 2016 +0300
@@ -75,7 +75,7 @@
         int failedTests;
         List<JVMOption> allOptions;
 
-        allOptionsAsMap = JVMOptionsUtils.getOptionsWithRangeAsMap();
+        allOptionsAsMap = JVMOptionsUtils.getOptionsWithRangeAsMap(origin -> (!(origin.contains("develop") || origin.contains("notproduct"))));
 
         /* Shared flags can cause JVM to exit with error code 2 */
         setAllowedExitCodes("SharedReadWriteSize", 2);