changeset 2728:7e470e1cd3b6

Removed special casing for exception phis in LIRGenerator. Removed dependency between LIRBlock.blockID and BlockBegin.blockID.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Thu, 19 May 2011 17:13:30 +0200
parents 1ddcbcd33325
children 108adba3345e
files graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java graal/GraalCompiler/src/com/sun/c1x/graph/IR.java graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java
diffstat 4 files changed, 4 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Thu May 19 17:04:30 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Thu May 19 17:13:30 2011 +0200
@@ -390,16 +390,6 @@
 
     @Override
     public void visitExceptionObject(ExceptionObject x) {
-
-        // no moves are created for phi functions at the begin of exception
-        // handlers, so assign operands manually here
-        currentBlock.stateBefore().forEachLivePhi(currentBlock.blockID(), new PhiProcedure() {
-            public boolean doPhi(Phi phi) {
-                operandForPhi(phi);
-                return true;
-            }
-        });
-
         XirSnippet snippet = xir.genExceptionObject(site(x));
         emitXir(snippet, x, stateFor(x), null, true);
     }
@@ -1442,7 +1432,7 @@
         if (x instanceof ExceptionEdgeInstruction) {
             BlockBegin begin = ((ExceptionEdgeInstruction) x).exceptionEdge();
             if (begin != null) {
-                exceptionEdge = begin.lirBlock();
+                exceptionEdge = getLIRBlock(begin);
             }
         }
         return new LIRDebugInfo(state, exceptionEdge);
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Thu May 19 17:04:30 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Thu May 19 17:13:30 2011 +0200
@@ -114,13 +114,15 @@
             List<BlockBegin> blocks = computeLinearScanOrder.linearScanOrder();
             orderedBlocks = new ArrayList<LIRBlock>();
 
+            int z = 0;
             for (BlockBegin bb : blocks) {
-                LIRBlock lirBlock = new LIRBlock(bb.blockID);
+                LIRBlock lirBlock = new LIRBlock(z);
                 bb.setLIRBlock(lirBlock);
                 lirBlock.setLinearScanNumber(bb.linearScanNumber());
                 // TODO(tw): Initialize LIRBlock.linearScanLoopHeader and LIRBlock.linearScanLoopEnd
                 lirBlock.setStateBefore(bb.stateBefore());
                 orderedBlocks.add(lirBlock);
+                ++z;
             }
 
             for (BlockBegin bb : blocks) {
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java	Thu May 19 17:04:30 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java	Thu May 19 17:13:30 2011 +0200
@@ -79,11 +79,6 @@
      */
     public final int blockID;
 
-    /**
-     * Denotes the current set of {@link BlockBegin.BlockFlag} settings.
-     */
-    private int blockFlags;
-
     private int depthFirstNumber;
     private int linearScanNumber;
 
--- a/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java	Thu May 19 17:04:30 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java	Thu May 19 17:13:30 2011 +0200
@@ -381,27 +381,6 @@
     }
 
     /**
-     * Traverses all live {@linkplain Phi phis} of a given block in this frame state.
-     *
-     * @param block only phis {@linkplain Phi#block() associated} with this block are traversed
-     * @param proc the call back invoked for each live phi traversed
-     */
-    public final boolean forEachLivePhi(int blockID, PhiProcedure proc) {
-        for (int i = 0; i < valuesSize(); i++) {
-            Value instr = valueAt(i);
-            if (instr instanceof Phi && !instr.isDeadPhi()) {
-                Phi phi = (Phi) instr;
-                if (phi.block().blockID == blockID) {
-                    if (!proc.doPhi(phi)) {
-                        return false;
-                    }
-                }
-            }
-        }
-        return true;
-    }
-
-    /**
      * Checks whether this frame state has any {@linkplain Phi phi} statements.
      */
     public boolean hasPhis() {