# HG changeset patch # User Thomas Wuerthinger # Date 1394552598 -3600 # Node ID 8bdebcc53d157716da807f4f5c4e6ca0a0437587 # Parent 8836f566b0bcb39780f0c41a6268675689ad2973 Remove nodesForBlock mapping in LIR data structure. diff -r 8836f566b0bc -r 8bdebcc53d15 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Mar 11 16:28:43 2014 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue Mar 11 16:43:18 2014 +0100 @@ -245,7 +245,7 @@ List codeEmittingOrder = ComputeBlockOrder.computeCodeEmittingOrder(blocks.length, startBlock, nodeProbabilities); List linearScanOrder = ComputeBlockOrder.computeLinearScanOrder(blocks.length, startBlock, nodeProbabilities); - lir = new LIR(schedule.getCFG(), schedule.getBlockToNodesMap(), linearScanOrder, codeEmittingOrder); + lir = new LIR(schedule.getCFG(), linearScanOrder, codeEmittingOrder); Debug.dump(lir, "After linear scan order"); } catch (Throwable e) { throw Debug.handle(e); diff -r 8836f566b0bc -r 8bdebcc53d15 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java Tue Mar 11 16:28:43 2014 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java Tue Mar 11 16:43:18 2014 +0100 @@ -27,7 +27,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.LIRInstruction.StateProcedure; import com.oracle.graal.lir.StandardOp.BlockEndOp; -import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.cfg.*; /** @@ -39,12 +38,6 @@ public final ControlFlowGraph cfg; /** - * The nodes for the blocks. TODO: This should go away, we want all nodes connected with a - * next-pointer. - */ - private final BlockMap> blockToNodesMap; - - /** * The linear-scan ordered list of blocks. */ private final List linearScanOrder; @@ -72,22 +65,14 @@ /** * Creates a new LIR instance for the specified compilation. */ - public LIR(ControlFlowGraph cfg, BlockMap> blockToNodesMap, List linearScanOrder, List codeEmittingOrder) { + public LIR(ControlFlowGraph cfg, List linearScanOrder, List codeEmittingOrder) { this.cfg = cfg; - this.blockToNodesMap = blockToNodesMap; this.codeEmittingOrder = codeEmittingOrder; this.linearScanOrder = linearScanOrder; this.lirInstructions = new BlockMap<>(cfg); } /** - * Gets the nodes in a given block. - */ - public List nodesFor(Block block) { - return blockToNodesMap.get(block); - } - - /** * Determines if any instruction in the LIR has debug info associated with it. */ public boolean hasDebugInfo() { diff -r 8836f566b0bc -r 8bdebcc53d15 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Tue Mar 11 16:28:43 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Tue Mar 11 16:43:18 2014 +0100 @@ -250,27 +250,20 @@ } } - if (lir != null) { - for (Node node : lir.nodesFor(block)) { - printNode(node, false); - } - } else { - Node cur = block.getBeginNode(); - while (true) { - printNode(cur, false); + Node cur = block.getBeginNode(); + while (true) { + printNode(cur, false); - if (cur == block.getEndNode()) { - for (Map.Entry entry : latestScheduling.entries()) { - if (entry.getValue() == block && !inFixedSchedule(entry.getKey()) && !printedNodes.isMarked(entry.getKey())) { - printNode(entry.getKey(), true); - } + if (cur == block.getEndNode()) { + for (Map.Entry entry : latestScheduling.entries()) { + if (entry.getValue() == block && !inFixedSchedule(entry.getKey()) && !printedNodes.isMarked(entry.getKey())) { + printNode(entry.getKey(), true); } - break; } - assert cur.successors().count() == 1; - cur = cur.successors().first(); + break; } - + assert cur.successors().count() == 1; + cur = cur.successors().first(); } out.enableIndentation();