changeset 19848:e532af44f9f9

Fix WriteBarrierAdditionTest.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 14 Mar 2015 12:14:26 +0100
parents e17f04731c61
children bcc0069dba6f
files graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java
diffstat 2 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java	Sat Mar 14 02:04:40 2015 +0100
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java	Sat Mar 14 12:14:26 2015 +0100
@@ -657,15 +657,13 @@
                     if (node instanceof WriteNode) {
                         WriteNode write = (WriteNode) node;
                         LocationIdentity obj = write.getLocationIdentity();
-                        if (obj instanceof ResolvedJavaField) {
-                            if (((ResolvedJavaField) obj).getName().equals("barrierIndex")) {
-                                /*
-                                 * A "barrierIndex" variable was found and is checked against the
-                                 * input barrier array.
-                                 */
-                                if (eliminateBarrier(write.value().asJavaConstant().asInt(), removedBarrierIndices)) {
-                                    return true;
-                                }
+                        if (obj.toString().equals("barrierIndex")) {
+                            /*
+                             * A "barrierIndex" variable was found and is checked against the input
+                             * barrier array.
+                             */
+                            if (eliminateBarrier(write.value().asJavaConstant().asInt(), removedBarrierIndices)) {
+                                return true;
                             }
                         }
                     } else if (node instanceof SerialWriteBarrier || node instanceof G1PostWriteBarrier) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java	Sat Mar 14 02:04:40 2015 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaFieldImpl.java	Sat Mar 14 12:14:26 2015 +0100
@@ -75,6 +75,11 @@
         public int hashCode() {
             return inner.hashCode();
         }
+
+        @Override
+        public String toString() {
+            return inner.name;
+        }
     }
 
     public HotSpotResolvedJavaFieldImpl(HotSpotResolvedObjectTypeImpl holder, String name, JavaType type, long offset, int modifiers) {