changeset 9525:038fa65cbd8d

Consistent naming of accessor methods in the LocationNode class hierarchy
author Christian Wimmer <christian.wimmer@oracle.com>
date Thu, 02 May 2013 10:38:48 -0700
parents ff8d87eabda8
children ae5cd887e67c
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/PushNodesThroughPiTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ReadAfterCheckCastTest.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ConstantLocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SnippetLocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java
diffstat 13 files changed, 38 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/PushNodesThroughPiTest.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/PushNodesThroughPiTest.java	Thu May 02 10:38:48 2013 -0700
@@ -66,7 +66,7 @@
                 StructuredGraph graph = compileTestSnippet(snippet);
 
                 for (ReadNode rn : graph.getNodes().filter(ReadNode.class)) {
-                    Object locId = rn.location().locationIdentity();
+                    Object locId = rn.location().getLocationIdentity();
                     if (locId instanceof ResolvedJavaField) {
                         ResolvedJavaField field = (ResolvedJavaField) locId;
                         if (field.getName().equals("x")) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ReadAfterCheckCastTest.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ReadAfterCheckCastTest.java	Thu May 02 10:38:48 2013 -0700
@@ -95,7 +95,7 @@
                 for (FloatingReadNode node : graph.getNodes(LocalNode.class).first().usages().filter(FloatingReadNode.class)) {
                     // Checking that the parameter a is not directly used for the access to field
                     // x10 (because x10 must be guarded by the checkcast).
-                    Assert.assertTrue(node.location().locationIdentity() == LocationNode.FINAL_LOCATION);
+                    Assert.assertTrue(node.location().getLocationIdentity() == LocationNode.FINAL_LOCATION);
                 }
             }
         });
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java	Thu May 02 10:38:48 2013 -0700
@@ -48,7 +48,7 @@
     }
 
     public static AddLocationNode create(LocationNode x, LocationNode y, Graph graph) {
-        assert x.getValueKind().equals(y.getValueKind()) && x.locationIdentity() == y.locationIdentity();
+        assert x.getValueKind().equals(y.getValueKind()) && x.getLocationIdentity() == y.getLocationIdentity();
         return graph.unique(new AddLocationNode(x, y));
     }
 
@@ -64,8 +64,8 @@
     }
 
     @Override
-    public Object locationIdentity() {
-        return getX().locationIdentity();
+    public Object getLocationIdentity() {
+        return getX().getLocationIdentity();
     }
 
     @Override
@@ -79,10 +79,10 @@
         if (x instanceof IndexedLocationNode && y instanceof IndexedLocationNode) {
             IndexedLocationNode xIdx = (IndexedLocationNode) x;
             IndexedLocationNode yIdx = (IndexedLocationNode) y;
-            if (xIdx.indexScaling() == yIdx.indexScaling()) {
-                long displacement = xIdx.displacement() + yIdx.displacement();
-                ValueNode index = IntegerArithmeticNode.add(xIdx.index(), yIdx.index());
-                return IndexedLocationNode.create(locationIdentity(), getValueKind(), displacement, index, graph(), xIdx.indexScaling());
+            if (xIdx.getIndexScaling() == yIdx.getIndexScaling()) {
+                long displacement = xIdx.getDisplacement() + yIdx.getDisplacement();
+                ValueNode index = IntegerArithmeticNode.add(xIdx.getIndex(), yIdx.getIndex());
+                return IndexedLocationNode.create(getLocationIdentity(), getValueKind(), displacement, index, graph(), xIdx.getIndexScaling());
             }
         }
         return this;
@@ -91,10 +91,10 @@
     private LocationNode canonical(ConstantLocationNode constant, LocationNode other) {
         if (other instanceof ConstantLocationNode) {
             ConstantLocationNode otherConst = (ConstantLocationNode) other;
-            return ConstantLocationNode.create(locationIdentity(), getValueKind(), otherConst.displacement() + constant.displacement(), graph());
+            return ConstantLocationNode.create(getLocationIdentity(), getValueKind(), otherConst.getDisplacement() + constant.getDisplacement(), graph());
         } else if (other instanceof IndexedLocationNode) {
             IndexedLocationNode otherIdx = (IndexedLocationNode) other;
-            return IndexedLocationNode.create(locationIdentity(), getValueKind(), otherIdx.displacement() + constant.displacement(), otherIdx.index(), graph(), otherIdx.indexScaling());
+            return IndexedLocationNode.create(getLocationIdentity(), getValueKind(), otherIdx.getDisplacement() + constant.getDisplacement(), otherIdx.getIndex(), graph(), otherIdx.getIndexScaling());
         } else if (other instanceof AddLocationNode) {
             AddLocationNode otherAdd = (AddLocationNode) other;
             LocationNode newInner = otherAdd.canonical(constant, otherAdd.getX());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ConstantLocationNode.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ConstantLocationNode.java	Thu May 02 10:38:48 2013 -0700
@@ -56,16 +56,16 @@
     }
 
     @Override
-    public Object locationIdentity() {
+    public Object getLocationIdentity() {
         return locationIdentity;
     }
 
-    public long displacement() {
+    public long getDisplacement() {
         return displacement;
     }
 
     @Override
     public Value generateAddress(LIRGeneratorTool gen, Value base) {
-        return gen.emitAddress(base, displacement(), Value.ILLEGAL, 0);
+        return gen.emitAddress(base, getDisplacement(), Value.ILLEGAL, 0);
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java	Thu May 02 10:38:48 2013 -0700
@@ -45,18 +45,18 @@
     /**
      * Gets the index or offset of this location.
      */
-    public ValueNode index() {
+    public ValueNode getIndex() {
         return index;
     }
 
-    public long displacement() {
+    public long getDisplacement() {
         return displacement;
     }
 
     /**
      * @return Constant that is used to scale the index.
      */
-    public int indexScaling() {
+    public int getIndexScaling() {
         return indexScaling;
     }
 
@@ -80,22 +80,22 @@
     }
 
     @Override
-    public Object locationIdentity() {
+    public Object getLocationIdentity() {
         return locationIdentity;
     }
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
         if (index == null || indexScaling == 0) {
-            return ConstantLocationNode.create(locationIdentity(), getValueKind(), displacement, graph());
+            return ConstantLocationNode.create(getLocationIdentity(), getValueKind(), displacement, graph());
         } else if (index.isConstant()) {
-            return ConstantLocationNode.create(locationIdentity(), getValueKind(), index.asConstant().asLong() * indexScaling + displacement, graph());
+            return ConstantLocationNode.create(getLocationIdentity(), getValueKind(), index.asConstant().asLong() * indexScaling + displacement, graph());
         }
         return this;
     }
 
     @Override
     public Value generateAddress(LIRGeneratorTool gen, Value base) {
-        return gen.emitAddress(base, displacement, gen.operand(index()), indexScaling());
+        return gen.emitAddress(base, displacement, gen.operand(getIndex()), getIndexScaling());
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java	Thu May 02 10:38:48 2013 -0700
@@ -87,7 +87,7 @@
      * {@link #ANY_LOCATION} and {@link #FINAL_LOCATION}, a different location identity of two
      * memory accesses guarantees that the two accesses do not interfere.
      */
-    public abstract Object locationIdentity();
+    public abstract Object getLocationIdentity();
 
     @Override
     public final void generate(LIRGeneratorTool generator) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu May 02 10:38:48 2013 -0700
@@ -74,8 +74,8 @@
     public static ValueNode canonicalizeRead(ValueNode read, LocationNode location, ValueNode object, CanonicalizerTool tool) {
         MetaAccessProvider runtime = tool.runtime();
         if (runtime != null && object != null && object.isConstant()) {
-            if (location.locationIdentity() == LocationNode.FINAL_LOCATION && location instanceof ConstantLocationNode) {
-                long displacement = ((ConstantLocationNode) location).displacement();
+            if (location.getLocationIdentity() == LocationNode.FINAL_LOCATION && location instanceof ConstantLocationNode) {
+                long displacement = ((ConstantLocationNode) location).getDisplacement();
                 Kind kind = location.getValueKind();
                 if (object.kind() == Kind.Object) {
                     Object base = object.asConstant().asObject();
@@ -101,7 +101,7 @@
 
     @Override
     public boolean push(PiNode parent) {
-        Object locId = location().locationIdentity();
+        Object locId = location().getLocationIdentity();
         if (locId instanceof ResolvedJavaField) {
             ResolvedJavaType fieldType = ((ResolvedJavaField) locId).getDeclaringClass();
             ValueNode piValueStamp = parent.object();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SnippetLocationNode.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SnippetLocationNode.java	Thu May 02 10:38:48 2013 -0700
@@ -65,7 +65,7 @@
     }
 
     @Override
-    public Object locationIdentity() {
+    public Object getLocationIdentity() {
         if (locationIdentity.isConstant()) {
             return locationIdentity.asConstant().asObject();
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java	Thu May 02 10:38:48 2013 -0700
@@ -94,6 +94,6 @@
 
     @Override
     public Object[] getLocationIdentities() {
-        return new Object[]{location().locationIdentity()};
+        return new Object[]{location().getLocationIdentity()};
     }
 }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java	Thu May 02 10:38:48 2013 -0700
@@ -156,7 +156,7 @@
         private static void processFloatable(FloatableAccessNode accessNode, MemoryMap state) {
             StructuredGraph graph = (StructuredGraph) accessNode.graph();
             assert accessNode.getNullCheck() == false;
-            Object locationIdentity = accessNode.location().locationIdentity();
+            Object locationIdentity = accessNode.location().getLocationIdentity();
             if (locationIdentity != LocationNode.ANY_LOCATION) {
                 ValueNode lastLocationAccess = state.getLastLocationAccess(locationIdentity);
                 FloatingAccessNode floatingNode = accessNode.asFloatingNode(lastLocationAccess);
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java	Thu May 02 10:38:48 2013 -0700
@@ -142,7 +142,7 @@
 
         private boolean isImplicitNullCheck(LocationNode location) {
             if (location instanceof ConstantLocationNode) {
-                return ((ConstantLocationNode) location).displacement() < implicitNullCheckLimit;
+                return ((ConstantLocationNode) location).getDisplacement() < implicitNullCheckLimit;
             } else {
                 return false;
             }
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Thu May 02 10:38:48 2013 -0700
@@ -92,7 +92,7 @@
                         for (Iterator<FloatingReadNode> iter = currentState.iterator(); iter.hasNext();) {
                             FloatingReadNode read = iter.next();
                             FixedNode fixed = (FixedNode) node;
-                            if (identity == LocationNode.ANY_LOCATION || read.location().locationIdentity() == identity) {
+                            if (identity == LocationNode.ANY_LOCATION || read.location().getLocationIdentity() == identity) {
                                 addPhantomReference(read, fixed);
                             }
                         }
--- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java	Thu May 02 10:36:09 2013 -0700
+++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java	Thu May 02 10:38:48 2013 -0700
@@ -112,15 +112,15 @@
 
         IndexedLocationNode location = (IndexedLocationNode) read.location();
         Assert.assertEquals(kind, location.getValueKind());
-        Assert.assertEquals(locationIdentity, location.locationIdentity());
-        Assert.assertEquals(1, location.indexScaling());
+        Assert.assertEquals(locationIdentity, location.getLocationIdentity());
+        Assert.assertEquals(1, location.getIndexScaling());
 
         if (indexConvert) {
-            ConvertNode convert = (ConvertNode) location.index();
+            ConvertNode convert = (ConvertNode) location.getIndex();
             Assert.assertEquals(ConvertNode.Op.I2L, convert.opcode);
             Assert.assertEquals(graph.getLocal(1), convert.value());
         } else {
-            Assert.assertEquals(graph.getLocal(1), location.index());
+            Assert.assertEquals(graph.getLocal(1), location.getIndex());
         }
 
         ReturnNode ret = (ReturnNode) read.next();
@@ -139,15 +139,15 @@
 
         IndexedLocationNode location = (IndexedLocationNode) write.location();
         Assert.assertEquals(kind, location.getValueKind());
-        Assert.assertEquals(locationIdentity, location.locationIdentity());
-        Assert.assertEquals(1, location.indexScaling());
+        Assert.assertEquals(locationIdentity, location.getLocationIdentity());
+        Assert.assertEquals(1, location.getIndexScaling());
 
         if (indexConvert) {
-            ConvertNode convert = (ConvertNode) location.index();
+            ConvertNode convert = (ConvertNode) location.getIndex();
             Assert.assertEquals(ConvertNode.Op.I2L, convert.opcode);
             Assert.assertEquals(graph.getLocal(1), convert.value());
         } else {
-            Assert.assertEquals(graph.getLocal(1), location.index());
+            Assert.assertEquals(graph.getLocal(1), location.getIndex());
         }
 
         AbstractStateSplit stateSplit = (AbstractStateSplit) write.next();