changeset 9650:8f9439edcf5b

prevent multiple method context objects for the same method from resulting in multiple IGV tree levels unless there the method actually inlines itself
author Doug Simon <doug.simon@oracle.com>
date Mon, 13 May 2013 10:58:32 +0200
parents dd62ccda1849
children 5d9b5cf6df2b
files graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java	Mon May 13 10:50:22 2013 +0200
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java	Mon May 13 10:58:32 2013 +0200
@@ -181,10 +181,18 @@
 
     private static List<String> getInlineContext() {
         List<String> result = new ArrayList<>();
+        Object last = null;
         for (Object o : Debug.context()) {
             JavaMethod method = GraalDebugConfig.asJavaMethod(o);
             if (method != null) {
-                result.add(MetaUtil.format("%H::%n(%p)", method));
+                if (last != method) {
+                    result.add(MetaUtil.format("%H::%n(%p)", method));
+                } else {
+                    // This prevents multiple adjacent method context objects for the same method
+                    // from resulting in multiple IGV tree levels. This works on the
+                    // assumption that real inlining debug scopes will have a graph
+                    // context object between the inliner and inlinee context objects.
+                }
             } else if (o instanceof DebugDumpScope) {
                 DebugDumpScope debugDumpScope = (DebugDumpScope) o;
                 if (debugDumpScope.decorator && !result.isEmpty()) {
@@ -193,6 +201,7 @@
                     result.add(debugDumpScope.name);
                 }
             }
+            last = o;
         }
         if (result.isEmpty()) {
             result.add("Top Scope");