# HG changeset patch # User Doug Simon # Date 1373568978 -7200 # Node ID 68d4d54575465b3b2cb11ae7ff486210ab1344f1 # Parent cd28ead65a5308c4786a061a17736c15fc3ff584 add sequential id prefixes to IGV graphs diff -r cd28ead65a53 -r 68d4d5457546 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Thu Jul 11 16:21:29 2013 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Thu Jul 11 20:56:18 2013 +0200 @@ -46,6 +46,7 @@ private GraphPrinter printer; private List previousInlineContext; + private int[] dumpIds = {}; private int failuresCount; /** @@ -69,6 +70,14 @@ } } + private int nextDumpId() { + int depth = previousInlineContext.size(); + if (dumpIds.length < depth) { + dumpIds = Arrays.copyOf(dumpIds, depth); + } + return dumpIds[depth - 1]++; + } + // This field must be lazily initialized as this class may be loaded in a version // VM startup phase at which not all required features (such as system properties) // are online. @@ -169,7 +178,7 @@ public void run() { // Finally, output the graph. try { - printer.print(graph, message, predefinedSchedule); + printer.print(graph, nextDumpId() + ":" + message, predefinedSchedule); } catch (IOException e) { failuresCount++; printer = null;