changeset 11369:03fb03763b63

small fixes for handling of -G:DebugValueSummary option
author Doug Simon <doug.simon@oracle.com>
date Tue, 20 Aug 2013 09:31:27 +0200
parents c64d90e962ed
children ece2cee9f85f
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java
diffstat 2 files changed, 32 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java	Tue Aug 20 07:59:52 2013 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java	Tue Aug 20 09:31:27 2013 +0200
@@ -50,9 +50,9 @@
     public static final OptionValue<String> MethodFilter = new OptionValue<>(null);
     @Option(help = "How to print metric and timing values:%n" +
                    "Name - aggregate by unqualified name%n" +
-                   "Thread - aggregate by qualified name and thread%n" +
+                   "Partial - aggregate by partially qualified name (e.g., A.B.C.D.Counter and X.Y.Z.D.Counter will be merged to D.Counter)%n" +
                    "Complete - aggregate by qualified name%n" +
-                   "Partial - aggregate by partially qualified name (e.g., A.B.C.D.Counter and X.Y.Z.D.Counter will be merged to D.Counter)")
+                   "Thread - aggregate by qualified name and thread")
     public static final OptionValue<String> DebugValueSummary = new OptionValue<>("Complete");
     @Option(help = "Send Graal IR to dump handlers on error")
     public static final OptionValue<Boolean> DumpOnError = new OptionValue<>(false);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Tue Aug 20 07:59:52 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Tue Aug 20 09:31:27 2013 +0200
@@ -174,6 +174,19 @@
 
         if (DebugEnabled.getValue()) {
             DebugEnvironment.initialize(log);
+
+            String summary = DebugValueSummary.getValue();
+            if (summary != null) {
+                switch (summary) {
+                    case "Name":
+                    case "Partial":
+                    case "Complete":
+                    case "Thread":
+                        break;
+                    default:
+                        throw new GraalInternalError("Unsupported value for DebugSummaryValue: %s", summary);
+                }
+            }
         }
 
         assert VerifyHotSpotOptionsPhase.checkOptions();
@@ -448,10 +461,13 @@
 
                 String summary = DebugValueSummary.getValue();
                 if (summary == null) {
-                    summary = "Scope";
+                    summary = "Complete";
                 }
                 switch (summary) {
-                    case "PartialScope": {
+                    case "Name":
+                        printSummary(topLevelMaps, sortedValues);
+                        break;
+                    case "Partial": {
                         DebugValueMap globalMap = new DebugValueMap("Global");
                         for (DebugValueMap map : topLevelMaps) {
                             flattenChildren(map, globalMap);
@@ -460,6 +476,16 @@
                         printMap(new DebugValueScope(null, globalMap), sortedValues);
                         break;
                     }
+                    case "Complete": {
+                        DebugValueMap globalMap = new DebugValueMap("Global");
+                        for (DebugValueMap map : topLevelMaps) {
+                            globalMap.addChild(map);
+                        }
+                        globalMap.group();
+                        globalMap.normalize();
+                        printMap(new DebugValueScope(null, globalMap), sortedValues);
+                        break;
+                    }
                     case "Thread":
                         for (DebugValueMap map : topLevelMaps) {
                             TTY.println("Showing the results for thread: " + map.getName());
@@ -468,20 +494,8 @@
                             printMap(new DebugValueScope(null, map), sortedValues);
                         }
                         break;
-                    case "Name":
-                        printSummary(topLevelMaps, sortedValues);
-                        break;
-                    case "Scope": // fall through
-                    default: {
-                        DebugValueMap globalMap = new DebugValueMap("Global");
-                        for (DebugValueMap map : topLevelMaps) {
-                            globalMap.addChild(map);
-                        }
-                        globalMap.group();
-                        globalMap.normalize();
-                        printMap(new DebugValueScope(null, globalMap), sortedValues);
-                        break;
-                    }
+                    default:
+                        throw new GraalInternalError("Unknown summary type: %s", summary);
                 }
             }
         }