# HG changeset patch # User Gilles Duboscq # Date 1427296596 -3600 # Node ID 87419b0d9bfbda955644e430e4c91ac09ae3e9b4 # Parent 3bda2c03d0891c58f04a24d957ba23705b857f68 BinaryGraphPrinter: if a schedule is available, also print he node-to-blocks mapping in addition to the block-to-nodes diff -r 3bda2c03d089 -r 87419b0d9bfb graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java Wed Mar 25 16:15:20 2015 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java Wed Mar 25 16:16:36 2015 +0100 @@ -141,8 +141,9 @@ } ControlFlowGraph cfg = schedule == null ? null : schedule.getCFG(); BlockMap> blockToNodes = schedule == null ? null : schedule.getBlockToNodesMap(); + NodeMap nodeToBlocks = schedule == null ? null : schedule.getNodeToBlockMap(); List blocks = cfg == null ? null : cfg.getBlocks(); - writeNodes(graph); + writeNodes(graph, nodeToBlocks); writeBlocks(blocks, blockToNodes); } @@ -399,7 +400,7 @@ return node.getId(); } - private void writeNodes(Graph graph) throws IOException { + private void writeNodes(Graph graph, NodeMap nodeToBlocks) throws IOException { ToDoubleFunction probabilities = null; if (PrintGraphProbabilities.getValue()) { try { @@ -421,6 +422,16 @@ props.put("probability", t); } } + if (nodeToBlocks != null) { + if (nodeToBlocks.isNew(node)) { + props.put("node-to-block", "NEW (not in schedule)"); + } else { + Block block = nodeToBlocks.get(node); + if (block != null) { + props.put("node-to-block", block.getId()); + } + } + } writeInt(getNodeId(node)); writePoolObject(nodeClass); writeByte(node.predecessor() == null ? 0 : 1);