Mercurial > hg > graal-jvmci-8
changeset 14144:8bdebcc53d15
Remove nodesForBlock mapping in LIR data structure.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 11 Mar 2014 16:43:18 +0100 |
parents | 8836f566b0bc |
children | 4ff08c0366ae |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java |
diffstat | 3 files changed, 12 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- 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<Block> codeEmittingOrder = ComputeBlockOrder.computeCodeEmittingOrder(blocks.length, startBlock, nodeProbabilities); List<Block> 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);
--- 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<List<ScheduledNode>> blockToNodesMap; - - /** * The linear-scan ordered list of blocks. */ private final List<Block> linearScanOrder; @@ -72,22 +65,14 @@ /** * Creates a new LIR instance for the specified compilation. */ - public LIR(ControlFlowGraph cfg, BlockMap<List<ScheduledNode>> blockToNodesMap, List<Block> linearScanOrder, List<Block> codeEmittingOrder) { + public LIR(ControlFlowGraph cfg, List<Block> linearScanOrder, List<Block> 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<ScheduledNode> nodesFor(Block block) { - return blockToNodesMap.get(block); - } - - /** * Determines if any instruction in the LIR has debug info associated with it. */ public boolean hasDebugInfo() {
--- 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<Node, Block> 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<Node, Block> 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();