diff graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java @ 2603:01c5c0443158

new node layout: Phi
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 06 May 2011 11:18:15 +0200
parents 768d77a1c7af
children 39aa89baa165
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java	Fri May 06 10:25:37 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java	Fri May 06 11:18:15 2011 +0200
@@ -24,6 +24,7 @@
 
 import java.util.*;
 
+import com.oracle.graal.graph.*;
 import com.sun.c1x.*;
 import com.sun.c1x.graph.*;
 import com.sun.c1x.ir.*;
@@ -32,8 +33,6 @@
 /**
  * The {@code FrameState} class encapsulates the frame state (i.e. local variables and
  * operand stack) at a particular point in the abstract interpretation.
- *
- * @author Ben L. Titzer
  */
 public abstract class FrameState {
 
@@ -297,8 +296,9 @@
      * Inserts a phi statement into the stack at the specified stack index.
      * @param block the block begin for which we are creating the phi
      * @param i the index into the stack for which to create a phi
+     * @param graph
      */
-    public void setupPhiForStack(BlockBegin block, int i) {
+    public void setupPhiForStack(BlockBegin block, int i, Graph graph) {
         Value p = stackAt(i);
         if (p != null) {
             if (p instanceof Phi) {
@@ -307,7 +307,7 @@
                     return;
                 }
             }
-            values[maxLocals + i] = new Phi(p.kind, block, -i - 1);
+            values[maxLocals + i] = new Phi(p.kind, block, -i - 1, graph);
         }
     }
 
@@ -315,8 +315,9 @@
      * Inserts a phi statement for the local at the specified index.
      * @param block the block begin for which we are creating the phi
      * @param i the index of the local variable for which to create the phi
+     * @param graph
      */
-    public void setupPhiForLocal(BlockBegin block, int i) {
+    public void setupPhiForLocal(BlockBegin block, int i, Graph graph) {
         Value p = values[i];
         if (p instanceof Phi) {
             Phi phi = (Phi) p;
@@ -324,7 +325,7 @@
                 return;
             }
         }
-        storeLocal(i, new Phi(p.kind, block, i));
+        storeLocal(i, new Phi(p.kind, block, i, graph));
     }
 
     /**
@@ -384,7 +385,7 @@
         }
     }
 
-    public void merge(BlockBegin block, FrameState other) {
+    public void merge(BlockBegin block, FrameState other, Graph graph) {
         checkSize(other);
         for (int i = 0; i < valuesSize(); i++) {
             Value x = values[i];
@@ -403,10 +404,10 @@
                     }
                     if (i < maxLocals) {
                         // this a local
-                        setupPhiForLocal(block, i);
+                        setupPhiForLocal(block, i, graph);
                     } else {
                         // this is a stack slot
-                        setupPhiForStack(block, i - maxLocals);
+                        setupPhiForStack(block, i - maxLocals, graph);
                     }
                 }
             }