changeset 18583:12bd2b344b08

replace usages of == with .equals()
author Doug Simon <doug.simon@oracle.com>
date Mon, 01 Dec 2014 10:43:01 +0100
parents 1b918c6ff5eb
children bf7db79a6e45 51d05f258309
files graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractJavaProfile.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.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/FloatableAccessNode.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/UnsafeAccessNode.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationBlockState.java graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java
diffstat 14 files changed, 22 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractJavaProfile.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractJavaProfile.java	Mon Dec 01 10:43:01 2014 +0100
@@ -84,7 +84,7 @@
     public T findEntry(ResolvedJavaType type) {
         if (pitems != null) {
             for (T pt : pitems) {
-                if (pt.getItem() == type) {
+                if (pt.getItem().equals(type)) {
                     return pt;
                 }
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java	Mon Dec 01 10:43:01 2014 +0100
@@ -211,7 +211,7 @@
          * @return {@code true} if the field is a well-known stable field.
          */
         public static boolean test(HotSpotResolvedJavaField field) {
-            return field == STRING_VALUE_FIELD;
+            return field.equals(STRING_VALUE_FIELD);
         }
 
         private static final ResolvedJavaField STRING_VALUE_FIELD;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java	Mon Dec 01 10:43:01 2014 +0100
@@ -51,7 +51,7 @@
     }
 
     public static AddLocationNode create(LocationNode x, LocationNode y, Graph graph) {
-        assert x.getValueKind().equals(y.getValueKind()) && x.getLocationIdentity() == y.getLocationIdentity();
+        assert x.getValueKind().equals(y.getValueKind()) && x.getLocationIdentity().equals(y.getLocationIdentity());
         return graph.unique(AddLocationNode.create(x, y));
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java	Mon Dec 01 10:43:01 2014 +0100
@@ -53,6 +53,6 @@
      * an attached write barrier with pre-semantics can not also float.
      */
     public boolean canFloat() {
-        return location().getLocationIdentity() != LocationIdentity.ANY_LOCATION && getBarrierType() == BarrierType.NONE;
+        return !location().getLocationIdentity().equals(LocationIdentity.ANY_LOCATION) && getBarrierType() == BarrierType.NONE;
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Mon Dec 01 10:43:01 2014 +0100
@@ -128,7 +128,7 @@
                     }
                 }
             }
-            if (location.getLocationIdentity() == LocationIdentity.ARRAY_LENGTH_LOCATION) {
+            if (location.getLocationIdentity().equals(LocationIdentity.ARRAY_LENGTH_LOCATION)) {
                 ValueNode length = GraphUtil.arrayLength(object);
                 if (length != null) {
                     // TODO Does this need a PiCastNode to the positive range?
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java	Mon Dec 01 10:43:01 2014 +0100
@@ -65,7 +65,7 @@
 
     @Override
     public Node canonical(CanonicalizerTool tool) {
-        if (this.getLocationIdentity() == LocationIdentity.ANY_LOCATION && offset().isConstant()) {
+        if (this.getLocationIdentity().equals(LocationIdentity.ANY_LOCATION) && offset().isConstant()) {
             long constantOffset = offset().asJavaConstant().asLong();
 
             // Try to canonicalize to a field access.
@@ -81,7 +81,7 @@
                 }
             }
         }
-        if (this.getLocationIdentity() == LocationIdentity.ANY_LOCATION) {
+        if (this.getLocationIdentity().equals(LocationIdentity.ANY_LOCATION)) {
             ResolvedJavaType receiverType = StampTool.typeOrNull(object());
             // Try to build a better location identity.
             if (receiverType != null && receiverType.isArray()) {
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java	Mon Dec 01 10:43:01 2014 +0100
@@ -148,7 +148,7 @@
                         break;
                     }
                 }
-                if (type != null && type != StampTool.typeOrNull(node)) {
+                if (type != null && !type.equals(StampTool.typeOrNull(node))) {
                     newKnownTypes.put(node, type);
                 }
             }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java	Mon Dec 01 10:43:01 2014 +0100
@@ -304,7 +304,7 @@
 
         private static void processAccess(MemoryAccess access, MemoryMapImpl state) {
             LocationIdentity locationIdentity = access.getLocationIdentity();
-            if (locationIdentity != LocationIdentity.ANY_LOCATION) {
+            if (!locationIdentity.equals(LocationIdentity.ANY_LOCATION)) {
                 MemoryNode lastLocationAccess = state.getLastLocationAccess(locationIdentity);
                 access.setLastLocationAccess(lastLocationAccess);
             }
@@ -321,7 +321,7 @@
         }
 
         private static void processIdentity(LocationIdentity identity, MemoryCheckpoint checkpoint, MemoryMapImpl state) {
-            if (identity == ANY_LOCATION) {
+            if (identity.equals(ANY_LOCATION)) {
                 state.lastMemorySnapshot.clear();
             }
             state.lastMemorySnapshot.put(identity, checkpoint);
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java	Mon Dec 01 10:43:01 2014 +0100
@@ -1045,9 +1045,9 @@
             LocationIdentity readLocation = frn.location().getLocationIdentity();
             assert !readLocation.isImmutable();
             if (frn.getLastLocationAccess() == node) {
-                assert identity == ANY_LOCATION || readLocation == identity || node instanceof MemoryCheckpoint.Multi : "location doesn't match: " + readLocation + ", " + identity;
+                assert identity.equals(ANY_LOCATION) || readLocation.equals(identity) || node instanceof MemoryCheckpoint.Multi : "location doesn't match: " + readLocation + ", " + identity;
                 state.clearBeforeLastLocation(frn);
-            } else if (!state.isBeforeLastLocation(frn) && (readLocation == identity || (node != getCFG().graph.start() && ANY_LOCATION == identity))) {
+            } else if (!state.isBeforeLastLocation(frn) && (readLocation.equals(identity) || (node != getCFG().graph.start() && ANY_LOCATION.equals(identity)))) {
                 state.removeRead(frn);
                 addToLatestSorting(frn, state);
             }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java	Mon Dec 01 10:43:01 2014 +0100
@@ -1016,7 +1016,7 @@
         if (replacee instanceof MemoryCheckpoint.Single) {
             // check if some node in snippet graph also kills the same location
             LocationIdentity locationIdentity = ((MemoryCheckpoint.Single) replacee).getLocationIdentity();
-            if (locationIdentity == ANY_LOCATION) {
+            if (locationIdentity.equals(ANY_LOCATION)) {
                 assert !(memoryMap.getLastLocationAccess(ANY_LOCATION) instanceof MemoryAnchorNode) : replacee + " kills ANY_LOCATION, but snippet does not";
             }
             assert kills.contains(locationIdentity) : replacee + " kills " + locationIdentity + ", but snippet doesn't contain a kill to this location";
@@ -1046,7 +1046,7 @@
             if (SnippetCounters.getValue()) {
                 // accesses to snippet counters are artificially introduced and violate the memory
                 // semantics.
-                if (locationIdentity == SnippetCounter.SNIPPET_COUNTER_LOCATION) {
+                if (locationIdentity.equals(SnippetCounter.SNIPPET_COUNTER_LOCATION)) {
                     continue;
                 }
             }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java	Mon Dec 01 10:43:01 2014 +0100
@@ -416,7 +416,7 @@
         }
 
         FrameState directCallState = invoke.stateAfter();
-        while (directCallState != null && directCallState.method() != callSiteProxyMethod) {
+        while (directCallState != null && !directCallState.method().equals(callSiteProxyMethod)) {
             directCallState = directCallState.outerFrameState();
         }
 
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java	Mon Dec 01 10:43:01 2014 +0100
@@ -111,7 +111,7 @@
     private static void processIdentity(PEReadEliminationBlockState state, LocationIdentity identity) {
         if (identity instanceof ResolvedJavaField) {
             state.killReadCache((ResolvedJavaField) identity);
-        } else if (identity == ANY_LOCATION) {
+        } else if (identity.equals(ANY_LOCATION)) {
             state.killReadCache();
         }
     }
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationBlockState.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationBlockState.java	Mon Dec 01 10:43:01 2014 +0100
@@ -80,7 +80,7 @@
 
         @Override
         public boolean conflicts(LocationIdentity other) {
-            return identity == other;
+            return identity.equals(other);
         }
     }
 
@@ -106,7 +106,7 @@
 
         @Override
         public boolean conflicts(LocationIdentity other) {
-            return locationIdentity == other;
+            return locationIdentity.equals(other);
         }
     }
 
@@ -123,7 +123,7 @@
 
         @Override
         public boolean conflicts(LocationIdentity other) {
-            return identity.getLocationIdentity() == other;
+            return identity.getLocationIdentity().equals(other);
         }
     }
 
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java	Mon Dec 01 10:29:05 2014 +0100
+++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java	Mon Dec 01 10:43:01 2014 +0100
@@ -118,7 +118,7 @@
         } else if (node instanceof UnsafeAccessNode) {
             if (node instanceof UnsafeLoadNode) {
                 UnsafeLoadNode load = (UnsafeLoadNode) node;
-                if (load.offset().isConstant() && load.getLocationIdentity() != LocationIdentity.ANY_LOCATION) {
+                if (load.offset().isConstant() && !load.getLocationIdentity().equals(LocationIdentity.ANY_LOCATION)) {
                     ValueNode object = GraphUtil.unproxify(load.object());
                     UnsafeLoadCacheEntry identifier = new UnsafeLoadCacheEntry(object, load.offset(), load.getLocationIdentity());
                     ValueNode cachedValue = state.getCacheEntry(identifier);
@@ -133,7 +133,7 @@
             } else {
                 assert node instanceof UnsafeStoreNode;
                 UnsafeStoreNode write = (UnsafeStoreNode) node;
-                if (write.offset().isConstant() && write.getLocationIdentity() != LocationIdentity.ANY_LOCATION) {
+                if (write.offset().isConstant() && !write.getLocationIdentity().equals(LocationIdentity.ANY_LOCATION)) {
                     ValueNode object = GraphUtil.unproxify(write.object());
                     UnsafeLoadCacheEntry identifier = new UnsafeLoadCacheEntry(object, write.offset(), write.getLocationIdentity());
                     ValueNode cachedValue = state.getCacheEntry(identifier);
@@ -161,7 +161,7 @@
     }
 
     private static void processIdentity(ReadEliminationBlockState state, LocationIdentity identity) {
-        if (identity == ANY_LOCATION) {
+        if (identity.equals(ANY_LOCATION)) {
             state.killReadCache();
             return;
         }