changeset 12198:77f3076526fc

Merge
author dnsimon
date Wed, 19 Oct 2016 18:57:06 +0000
parents 51277d8704af d7f89a030d77
children 204391ad6da1
files
diffstat 4 files changed, 25 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/.mx.jvmci/.pydevproject	Wed Oct 19 17:53:01 2016 +0000
+++ b/.mx.jvmci/.pydevproject	Wed Oct 19 18:57:06 2016 +0000
@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse-pydev version="1.0"?>
-
-<pydev_project>
+<?eclipse-pydev version="1.0"?><pydev_project>
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
 <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/mx.jvmci</path>
+<path>/.mx.jvmci</path>
 </pydev_pathproperty>
 <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
 <path>/mx</path>
--- a/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Wed Oct 19 17:53:01 2016 +0000
+++ b/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Wed Oct 19 18:57:06 2016 +0000
@@ -171,6 +171,9 @@
             return (String) getValue();
         }
 
+        private static final int PROPERTY_LINE_WIDTH = 80;
+        private static final int PROPERTY_HELP_INDENT = 10;
+
         /**
          * Prints a description of the properties used to configure shared JVMCI code.
          *
@@ -178,24 +181,26 @@
          */
         public static void printProperties(PrintStream out) {
             out.println("[JVMCI properties]");
-            int typeWidth = 0;
-            int nameWidth = 0;
             Option[] values = values();
             for (Option option : values) {
-                typeWidth = Math.max(typeWidth, option.type.getSimpleName().length());
-                nameWidth = Math.max(nameWidth, option.getPropertyName().length());
-            }
-            for (Option option : values) {
                 Object value = option.getValue();
                 if (value instanceof String) {
                     value = '"' + String.valueOf(value) + '"';
                 }
-                String assign = option.isDefault ? " =" : ":=";
-                String format = "%" + (typeWidth + 1) + "s %-" + (nameWidth + 1) + "s %s %s%n";
-                out.printf(format, option.type.getSimpleName(), option.getPropertyName(), assign, value);
-                String helpFormat = "%" + (typeWidth + 1) + "s %s%n";
+
+                String name = option.getPropertyName();
+                String assign = option.isDefault ? "=" : ":=";
+                String typeName = option.type.getSimpleName();
+                String linePrefix = String.format("%s %s %s ", name, assign, value);
+                int typeStartPos = PROPERTY_LINE_WIDTH - typeName.length();
+                int linePad = typeStartPos - linePrefix.length();
+                if (linePad > 0) {
+                    out.printf("%s%-" + linePad + "s[%s]%n", linePrefix, "", typeName);
+                } else {
+                    out.printf("%s[%s]%n", linePrefix, typeName);
+                }
                 for (String line : option.helpLines) {
-                    out.printf(helpFormat, "", line);
+                    out.printf("%" + PROPERTY_HELP_INDENT + "s%s%n", "", line);
                 }
             }
         }
@@ -306,6 +311,7 @@
             PrintStream out = new PrintStream(getLogStream());
             Option.printProperties(out);
             compilerFactory.printProperties(out);
+            System.exit(0);
         }
 
         if (Option.PrintConfig.getBoolean()) {
--- a/src/share/vm/jvmci/jvmci_globals.hpp	Wed Oct 19 17:53:01 2016 +0000
+++ b/src/share/vm/jvmci/jvmci_globals.hpp	Wed Oct 19 18:57:06 2016 +0000
@@ -50,7 +50,7 @@
           "Use JVMCI as the default compiler")                              \
                                                                             \
   experimental(bool, JVMCIPrintProperties, false,                           \
-          "Prints properties used by the JVMCI compiler")                   \
+          "Prints properties used by the JVMCI compiler and exits")         \
                                                                             \
   experimental(bool, BootstrapJVMCI, false,                                 \
           "Bootstrap JVMCI before running Java main method")                \
--- a/test/compiler/jvmci/TestJVMCIPrintProperties.java	Wed Oct 19 17:53:01 2016 +0000
+++ b/test/compiler/jvmci/TestJVMCIPrintProperties.java	Wed Oct 19 18:57:06 2016 +0000
@@ -37,14 +37,13 @@
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
             "-XX:+UnlockExperimentalVMOptions",
             "-XX:+EnableJVMCI",
-            "-XX:+JVMCIPrintProperties",
-            "-version");
+            "-XX:+JVMCIPrintProperties");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         output.shouldContain("[JVMCI properties]"); // expected message
-        output.shouldContain("String jvmci.Compiler"); // expected message
-        output.shouldContain("Boolean jvmci.InitTimer"); // expected message
-        output.shouldContain("Boolean jvmci.PrintConfig"); // expected message
-        output.shouldContain("String jvmci.TraceMethodDataFilter"); // expected message
+        output.shouldContain("jvmci.Compiler = null"); // expected message
+        output.shouldContain("jvmci.InitTimer = false"); // expected message
+        output.shouldContain("jvmci.PrintConfig = false"); // expected message
+        output.shouldContain("jvmci.TraceMethodDataFilter = null"); // expected message
         output.shouldHaveExitValue(0);
     }
 }