changeset 2780:79dda81dd337

Cleanup
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 25 May 2011 11:12:51 +0200
parents 93ec3f067420
children 915456e4959e
files graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java graal/GraalCompiler/src/com/sun/c1x/graph/CriticalEdgeFinder.java graal/GraalCompiler/src/com/sun/c1x/graph/IR.java
diffstat 4 files changed, 0 insertions(+), 113 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java	Wed May 25 11:04:59 2011 +0200
+++ b/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Block.java	Wed May 25 11:12:51 2011 +0200
@@ -24,7 +24,6 @@
 
 import java.util.*;
 
-import com.sun.c1x.debug.*;
 import com.sun.c1x.ir.*;
 
 
@@ -73,16 +72,4 @@
     public String toString() {
         return "B" + blockID;
     }
-
-    public void removeExceptionSuccessors() {
-        for (int i = 0; i < successors.size(); ++i) {
-            TTY.println("checking succ");
-            if (successors.get(i).isExceptionEntry()) {
-                TTY.println("removing successor " + i);
-                successors.remove(i);
-                i--;
-            }
-        }
-
-    }
 }
--- a/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java	Wed May 25 11:04:59 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java	Wed May 25 11:12:51 2011 +0200
@@ -27,7 +27,6 @@
 
 import java.util.*;
 
-import com.oracle.graal.graph.*;
 import com.sun.c1x.*;
 import com.sun.c1x.alloc.Interval.*;
 import com.sun.c1x.debug.*;
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/CriticalEdgeFinder.java	Wed May 25 11:04:59 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/CriticalEdgeFinder.java	Wed May 25 11:12:51 2011 +0200
@@ -99,42 +99,16 @@
      */
     public LIRBlock splitEdge(LIRBlock source, LIRBlock target) {
 
-        int backEdgeIndex = target.blockPredecessors().indexOf(source);
-
         // create new successor and mark it for special block order treatment
         LIRBlock newSucc = new LIRBlock(lirBlocks.size());
         lirBlocks.add(newSucc);
 
-        List<Integer> removePhiInputs = null;
-        for (int i = backEdgeIndex + 1; i < target.blockPredecessors().size(); ++i) {
-            if (target.blockPredecessors().get(i) == source) {
-                if (removePhiInputs == null) {
-                    removePhiInputs = new ArrayList<Integer>(4);
-                }
-                removePhiInputs.add(i);
-            }
-        }
-
         // This goto is not a safepoint.
         Goto e = new Goto(target.getInstructions().get(0), graph);
         newSucc.getInstructions().add(e);
-        //e.reorderSuccessor(0, backEdgeIndex);
 
         // link predecessor to new block
         ((BlockEnd) source.getInstructions().get(source.getInstructions().size() - 1)).successors().replace(target.getInstructions().get(0), newSucc.getInstructions().get(0));
-/*        if (removePhiInputs != null && removePhiInputs.size() > 0) {
-
-            for (Node n : target.getInstructions().get(0).usages()) {
-                if (n instanceof Phi) {
-                    Phi phi = (Phi) n;
-                    int correction = 0;
-                    for (int index : removePhiInputs) {
-                        phi.removeInput(index - correction);
-                        correction++;
-                    }
-                }
-            }
-        }*/
 
         source.substituteSuccessor(target, newSucc);
         target.substitutePredecessor(source, newSucc);
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Wed May 25 11:04:59 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Wed May 25 11:12:51 2011 +0200
@@ -24,7 +24,6 @@
 
 import java.util.*;
 
-import com.oracle.graal.graph.*;
 import com.oracle.max.graal.schedule.*;
 import com.sun.c1x.*;
 import com.sun.c1x.debug.*;
@@ -109,9 +108,6 @@
 
 
      // TODO(tw): Schedule nodes within a block.
-        //computeLinearScanOrder();
-
-//        assert orderedBlocks.size() == lirBlocks.size();
 
 
         CriticalEdgeFinder finder = new CriticalEdgeFinder(lirBlocks, compilation.graph);
@@ -137,26 +133,6 @@
         int z = 0;
         for (LIRBlock b : orderedBlocks) {
             b.setLinearScanNumber(z++);
-
-        /*    TTY.println();
-
-            for (Instruction i : b.getInstructions()) {
-                if (i instanceof BlockBegin) {
-                    TTY.println("BlockBegin #" + ((BlockBegin) i).blockID);
-
-                    TTY.print("    => succs: ");
-                    for (LIRBlock succBlock : b.blockSuccessors()) {
-                        TTY.print("B#" + ((BlockBegin) succBlock.getInstructions().get(0)).blockID);
-                    }
-                    TTY.print("    => ex: ");
-                    for (LIRBlock succBlock : b.getExceptionHandlerSuccessors()) {
-                        TTY.print("B#" + ((BlockBegin) succBlock.getInstructions().get(0)).blockID);
-                    }
-                    TTY.println();
-                } else {
-                    TTY.println(i.getClass().getSimpleName() + " #" + i.id());
-                }
-            }*/
         }
 
 
@@ -176,55 +152,6 @@
         }
     }
 
-    private Map<Value, LIRBlock> computeLinearScanOrder() {
-        return makeLinearScanOrder();
-    }
-
-    private Map<Value, LIRBlock> makeLinearScanOrder() {
-/*
-        if (orderedBlocks == null) {
-
-            Map<Value, LIRBlock> valueToBlock = new HashMap<Value, LIRBlock>();
-            ComputeLinearScanOrder computeLinearScanOrder = new ComputeLinearScanOrder(compilation.stats.blockCount, getHIRStartBlock());
-            List<BlockBegin> blocks = computeLinearScanOrder.linearScanOrder();
-            orderedBlocks = new ArrayList<LIRBlock>();
-
-            int z = 0;
-            for (BlockBegin bb : blocks) {
-                LIRBlock lirBlock = new LIRBlock(z);
-                lirBlock.getInstructions().add(bb);
-                valueToBlock.put(bb, lirBlock);
-                lirBlock.setLinearScanNumber(bb.linearScanNumber());
-                // TODO(tw): Initialize LIRBlock.linearScanLoopHeader and LIRBlock.linearScanLoopEnd
-                orderedBlocks.add(lirBlock);
-                ++z;
-            }
-
-            z = 0;
-            for (BlockBegin bb : blocks) {
-                LIRBlock lirBlock = orderedBlocks.get(z);
-                for (int i = 0; i < bb.numberOfPreds(); ++i) {
-                    lirBlock.blockPredecessors().add(valueToBlock.get(bb.predAt(i).block()));
-                }
-
-                BlockEnd end = bb.end();
-                for (int i = 0; i < end.blockSuccessorCount(); ++i) {
-                    lirBlock.blockSuccessors().add(valueToBlock.get(end.blockSuccessor(i)));
-                }
-
-                Instruction first = bb;
-                while (first != null) {
-                    lirBlock.getInstructions().add(first);
-                    first = first.next();
-                }
-                ++z;
-            }
-
-        }*/
-        return null;
-        //return valueToBlock;
-    }
-
     /**
      * Gets the linear scan ordering of blocks as a list.
      * @return the blocks in linear scan order