changeset 22719:f035cf1d2e5a

Merge.
author Doug Simon <doug.simon@oracle.com>
date Tue, 29 Sep 2015 14:56:58 +0200
parents b415eaae0aa9 (current diff) f7693dc4e341 (diff)
children bba4e91a2d63
files mx.graal/suite.py
diffstat 5 files changed, 32 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Tue Sep 29 14:55:03 2015 +0200
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Tue Sep 29 14:56:58 2015 +0200
@@ -289,7 +289,7 @@
         append(new LoadDataAddressOp(dst, data));
     }
 
-    protected SPARCAddressValue asAddressValue(Value address) {
+    public SPARCAddressValue asAddressValue(Value address) {
         if (address instanceof SPARCAddressValue) {
             return (SPARCAddressValue) address;
         } else {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java	Tue Sep 29 14:55:03 2015 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java	Tue Sep 29 14:56:58 2015 +0200
@@ -233,4 +233,12 @@
         return merge() instanceof LoopBeginNode;
     }
 
+    public boolean hasValidInput() {
+        for (ValueNode n : values()) {
+            if (n != null) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java	Tue Sep 29 14:55:03 2015 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java	Tue Sep 29 14:56:58 2015 +0200
@@ -164,6 +164,9 @@
                     if (usage.isAlive()) {
                         if (usage instanceof PhiNode) {
                             usage.replaceFirstInput(node, null);
+                            if (!((PhiNode) usage).hasValidInput()) {
+                                propagateKill(usage);
+                            }
                         } else {
                             propagateKill(usage);
                         }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java	Tue Sep 29 14:55:03 2015 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java	Tue Sep 29 14:56:58 2015 +0200
@@ -134,6 +134,7 @@
 public class SnippetTemplate {
 
     private static final boolean EAGER_SNIPPETS = Boolean.getBoolean("graal.snippets.eager");
+    private boolean mayRemoveLocation = false;
 
     /**
      * Holds the {@link ResolvedJavaMethod} of the snippet, together with some information about the
@@ -1236,8 +1237,9 @@
                     if (pos.getInputType() == InputType.Memory && pos.get(usage) == node) {
                         MemoryNode replacement = map.getLastLocationAccess(location);
                         if (replacement == null) {
-                            assert LocationIdentity.any().equals(location) || Arrays.stream(info.privateLocations).anyMatch(Predicate.isEqual(location)) : "Snippet " + info.method.format("%h.%n") +
-                                            " contains access to the non-private location " + location + ", but replacee doesn't access this location." + map.getLocations();
+                            assert mayRemoveLocation || LocationIdentity.any().equals(location) || Arrays.stream(info.privateLocations).anyMatch(Predicate.isEqual(location)) : "Snippet " +
+                                            info.method.format("%h.%n") + " contains access to the non-private location " + location + ", but replacee doesn't access this location." +
+                                            map.getLocations();
                         } else {
                             pos.set(usage, replacement.asNode());
                         }
@@ -1496,4 +1498,8 @@
         }
         return true;
     }
+
+    public void setMayRemoveLocation(boolean mayRemoveLocation) {
+        this.mayRemoveLocation = mayRemoveLocation;
+    }
 }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ArrayEqualsNode.java	Tue Sep 29 14:55:03 2015 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ArrayEqualsNode.java	Tue Sep 29 14:56:58 2015 +0200
@@ -78,6 +78,18 @@
         this.length = length;
     }
 
+    public ValueNode getArray1() {
+        return array1;
+    }
+
+    public ValueNode getArray2() {
+        return array2;
+    }
+
+    public ValueNode getLength() {
+        return length;
+    }
+
     @Override
     public Node canonical(CanonicalizerTool tool) {
         if (tool.allUsagesAvailable() && hasNoUsages()) {