diff graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java @ 2584:06b2eac2f5d3

changed Instruction.isAppended to boolean flag (instead of next == this logic)
author Lukas Stadler <lukas.stadler@jku.at>
date Thu, 05 May 2011 14:02:34 +0200
parents 768d77a1c7af
children 3e0e65161345
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java	Thu May 05 13:47:27 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java	Thu May 05 14:02:34 2011 +0200
@@ -66,7 +66,7 @@
         return (Instruction) successors().get(super.successorCount() + SUCCESSOR_NEXT);
     }
 
-    public Node setNext(Instruction next) {
+    private Node setNext(Instruction next) {
         return successors().set(super.successorCount() + SUCCESSOR_NEXT, next);
     }
 
@@ -84,6 +84,9 @@
      */
     private List<ExceptionHandler> exceptionHandlers = ExceptionHandler.ZERO_HANDLERS;
 
+
+    private boolean isAppended = false;
+
     /**
      * Constructs a new instruction with the specified value type.
      * @param kind the value type for this instruction
@@ -121,7 +124,7 @@
      * @return {@code true} if this instruction has been added to the basic block containing it
      */
     public final boolean isAppended() {
-        return next() != this;
+        return isAppended;
     }
 
 
@@ -137,9 +140,7 @@
         if (next != null) {
             assert !(this instanceof BlockEnd);
             next.setBCI(bci);
-            if (next.next() == next) {
-                next.setNext(null);
-            }
+            next.isAppended = true;
         }
         return next;
     }