diff graal/GraalCompiler/src/com/sun/c1x/graph/BlockUtil.java @ 2707:7ed72769d51a

exception handling related changes: * changed blockPredecessors to list of Instructions, instead of Blocks * removed explicit predecessor management in BlockBegin, now using predecessors from Graph structure * replaced generated LIR exception entries with exception dispatch chains in IR * added Unwind and ExceptionDispatch instructions * removed ExceptionEntry flag in BlockBegin and all code depending on it * removed exceptionHandler list from Instruction, replaced by exception Edge on Invoke and Throw * replaced list of ExceptionHandlers with single exception edge in debug info misc: * changed GraphvizPrinter layout (smaller ports on large nodes) * removed defunct run config
author Lukas Stadler <lukas.stadler@jku.at>
date Wed, 18 May 2011 18:09:20 +0200
parents 6ab73784566a
children
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/BlockUtil.java	Fri May 13 17:09:20 2011 -0700
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/BlockUtil.java	Wed May 18 18:09:20 2011 +0200
@@ -22,12 +22,12 @@
  */
 package com.sun.c1x.graph;
 
+import java.util.*;
+
 import com.sun.c1x.ir.*;
 
 /**
  * The {@code BlockUtil} class contains a number of utilities for manipulating a CFG of basic blocks.
- *
- * @author Ben L. Titzer
  */
 public class BlockUtil {
 
@@ -36,11 +36,10 @@
      * @param block the block to remove from the graph
      */
     public static void disconnectFromGraph(BlockBegin block) {
-        for (BlockEnd p : block.blockPredecessors()) {
-            p.blockSuccessors().remove(block);
+        ArrayList<Instruction> preds = new ArrayList<Instruction>(block.blockPredecessors());
+        for (Instruction p : preds) {
+            p.block().end().blockSuccessors().remove(block);
         }
-        for (BlockBegin s : block.end().blockSuccessors()) {
-            s.blockPredecessors().remove(block);
-        }
+        block.end().clearSuccessors();
     }
 }