changeset 14972:0e111aab730c

Move hasBlockEnd from NodeLIRBuilder to LIRGenerator.
author Josef Eisl <josef.eisl@jku.at>
date Fri, 04 Apr 2014 12:45:58 +0200
parents 63bc517c3543
children 20b3db86b1fa
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java
diffstat 2 files changed, 9 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Thu Apr 03 10:23:34 2014 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Fri Apr 04 12:45:58 2014 +0200
@@ -315,11 +315,6 @@
 
     public void append(LIRInstruction op) {
         if (printIRWithLIR && !TTY.isSuppressed()) {
-            // if (currentInstruction != null && lastInstructionPrinted != currentInstruction) {
-            // lastInstructionPrinted = currentInstruction;
-            // InstructionPrinter ip = new InstructionPrinter(TTY.out());
-            // ip.printInstructionListing(currentInstruction);
-            // }
             TTY.println(op.toStringWithIdPrefix());
             TTY.println();
         }
@@ -327,6 +322,14 @@
         res.getLIR().getLIRforBlock(currentBlock).add(op);
     }
 
+    public boolean hasBlockEnd(AbstractBlock<?> block) {
+        List<LIRInstruction> ops = getResult().getLIR().getLIRforBlock(block);
+        if (ops.size() == 0) {
+            return false;
+        }
+        return ops.get(ops.size() - 1) instanceof BlockEndOp;
+    }
+
     public final void doBlockStart(AbstractBlock<?> block) {
         if (printIRWithLIR) {
             TTY.print(block.toString());
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java	Thu Apr 03 10:23:34 2014 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java	Fri Apr 04 12:45:58 2014 +0200
@@ -37,7 +37,6 @@
 import com.oracle.graal.debug.Debug.Scope;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.lir.*;
-import com.oracle.graal.lir.StandardOp.BlockEndOp;
 import com.oracle.graal.lir.StandardOp.JumpOp;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.PhiNode.PhiType;
@@ -227,7 +226,7 @@
             }
         }
 
-        if (!hasBlockEnd(block)) {
+        if (!gen.hasBlockEnd(block)) {
             NodeClassIterable successors = block.getEndNode().successors();
             assert successors.count() == block.getSuccessorCount();
             if (block.getSuccessorCount() != 1) {
@@ -392,14 +391,6 @@
 
     protected abstract boolean peephole(ValueNode valueNode);
 
-    private boolean hasBlockEnd(Block block) {
-        List<LIRInstruction> ops = gen.getResult().getLIR().getLIRforBlock(block);
-        if (ops.size() == 0) {
-            return false;
-        }
-        return ops.get(ops.size() - 1) instanceof BlockEndOp;
-    }
-
     private void doRoot(ValueNode instr) {
         if (gen.traceLevel >= 2) {
             TTY.println("Emitting LIR for instruction " + instr);