changeset 12721:dac9c1783aed

Use correct type for LocationIdentity in MemoryPhi.
author Roland Schatz <roland.schatz@oracle.com>
date Fri, 08 Nov 2013 13:20:34 +0100
parents 8898d449f95d
children b87c2f34e0e0
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ProxyNode.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java
diffstat 3 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java	Fri Nov 08 13:20:09 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java	Fri Nov 08 13:20:34 2013 +0100
@@ -51,7 +51,7 @@
     @Input(notDataflow = true) private MergeNode merge;
     @Input private final NodeInputList<ValueNode> values = new NodeInputList<>(this);
     private final PhiType type;
-    private final Object identity;
+    private final LocationIdentity identity;
 
     /**
      * Create a value phi ({@link PhiType#Value}) with the specified kind.
@@ -77,7 +77,7 @@
      * @param type the type of the new phi
      * @param merge the merge that the new phi belongs to
      */
-    public PhiNode(PhiType type, MergeNode merge, Object identity) {
+    public PhiNode(PhiType type, MergeNode merge, LocationIdentity identity) {
         super(type.stamp);
         assert type.stamp != null : merge + " " + type;
         this.type = type;
@@ -93,7 +93,7 @@
         return merge;
     }
 
-    public Object getIdentity() {
+    public LocationIdentity getIdentity() {
         assert type != PhiType.Value;
         return identity;
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ProxyNode.java	Fri Nov 08 13:20:09 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ProxyNode.java	Fri Nov 08 13:20:34 2013 +0100
@@ -22,6 +22,7 @@
  */
 package com.oracle.graal.nodes;
 
+import com.oracle.graal.api.meta.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.graph.Node.ValueNumberable;
 import com.oracle.graal.graph.spi.*;
@@ -41,9 +42,9 @@
     @Input(notDataflow = true) private AbstractBeginNode proxyPoint;
     @Input private ValueNode value;
     private final PhiType type;
-    private final Object identity;
+    private final LocationIdentity identity;
 
-    public ProxyNode(ValueNode value, AbstractBeginNode exit, PhiType type, Object identity) {
+    public ProxyNode(ValueNode value, AbstractBeginNode exit, PhiType type, LocationIdentity identity) {
         super(type == PhiType.Value ? value.stamp() : type.stamp);
         this.type = type;
         this.identity = identity;
@@ -69,7 +70,7 @@
         return type;
     }
 
-    public Object getIdentity() {
+    public LocationIdentity getIdentity() {
         assert type != PhiType.Value;
         return identity;
     }
@@ -113,7 +114,7 @@
         return graph.unique(new ProxyNode(value, exit, PhiType.Value, null));
     }
 
-    public static ProxyNode forMemory(ValueNode value, AbstractBeginNode exit, Object location, StructuredGraph graph) {
+    public static ProxyNode forMemory(ValueNode value, AbstractBeginNode exit, LocationIdentity location, StructuredGraph graph) {
         return graph.unique(new ProxyNode(value, exit, PhiType.Memory, location));
     }
 
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Fri Nov 08 13:20:09 2013 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Fri Nov 08 13:20:34 2013 +0100
@@ -189,7 +189,7 @@
                 MergeNode mergeNode = (MergeNode) block.getBeginNode();
                 for (PhiNode phi : mergeNode.usages().filter(PhiNode.class)) {
                     if (phi.type() == PhiType.Memory) {
-                        LocationIdentity identity = (LocationIdentity) phi.getIdentity();
+                        LocationIdentity identity = phi.getIdentity();
                         locationKilledBy(identity, phi, currentState);
                     }
                 }
@@ -266,7 +266,7 @@
                 for (Node usage : begin.usages()) {
                     if (usage instanceof ProxyNode && ((ProxyNode) usage).type() == PhiType.Memory) {
                         ProxyNode proxy = (ProxyNode) usage;
-                        LocationIdentity identity = (LocationIdentity) proxy.getIdentity();
+                        LocationIdentity identity = proxy.getIdentity();
                         locationKilledBy(identity, proxy, exitState);
                     }
                 }