changeset 16742:6052c5456170

LIRIntrospection.forEach: write back only if value has changed.
author Josef Eisl <josef.eisl@jku.at>
date Fri, 08 Aug 2014 18:45:37 +0200
parents 705cebda4776
children 3bfeb592ed76
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java	Fri Aug 08 18:13:50 2014 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java	Fri Aug 08 18:45:37 2014 +0200
@@ -133,7 +133,9 @@
                 } else {
                     newValue = proc.doValue(inst, value, mode, flags[i]);
                 }
-                setValue(inst, offsets[i], newValue);
+                if (!value.identityEquals(newValue)) {
+                    setValue(inst, offsets[i], newValue);
+                }
             } else {
                 Value[] values = getValueArray(inst, offsets[i]);
                 for (int j = 0; j < values.length; j++) {
@@ -145,7 +147,9 @@
                     } else {
                         newValue = proc.doValue(inst, value, mode, flags[i]);
                     }
-                    values[j] = newValue;
+                    if (!value.identityEquals(newValue)) {
+                        values[j] = newValue;
+                    }
                 }
             }
         }