changeset 16287:90046b8aae8a

Fix ValuePosition recursive lookup issue for CompositeValues.
author Josef Eisl <josef.eisl@jku.at>
date Thu, 26 Jun 2014 12:03:32 +0200
parents 95e147b30dd0
children b58855f3990e
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValuePosition.java
diffstat 1 files changed, 3 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValuePosition.java	Thu Jun 26 12:01:22 2014 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValuePosition.java	Thu Jun 26 12:03:32 2014 +0200
@@ -47,24 +47,13 @@
         this.superPosition = superPosition;
     }
 
-    private static CompositeValue getCompositeValue(LIRInstruction inst, ValuePosition pos) {
-        Value value;
-        if (pos.isCompositePosition()) {
-            value = getCompositeValue(inst, pos.getSuperPosition());
-        } else {
-            value = inst.getLIRInstructionClass().getValue(inst, pos);
-        }
-        assert value instanceof CompositeValue : "only CompositeValue can contain nested values " + value;
-        return (CompositeValue) value;
-    }
-
     public boolean isCompositePosition() {
         return superPosition != ROOT_VALUE_POSITION;
     }
 
     public Value get(LIRInstruction inst) {
         if (isCompositePosition()) {
-            CompositeValue compValue = getCompositeValue(inst, this);
+            CompositeValue compValue = (CompositeValue) superPosition.get(inst);
             return compValue.getValueClass().getValue(compValue, this);
         }
         return inst.getLIRInstructionClass().getValue(inst, this);
@@ -72,7 +61,7 @@
 
     public EnumSet<OperandFlag> getFlags(LIRInstruction inst) {
         if (isCompositePosition()) {
-            CompositeValue compValue = getCompositeValue(inst, this);
+            CompositeValue compValue = (CompositeValue) superPosition.get(inst);
             return compValue.getValueClass().getFlags(this);
         }
         return inst.getLIRInstructionClass().getFlags(this);
@@ -80,7 +69,7 @@
 
     public void set(LIRInstruction inst, Value value) {
         if (isCompositePosition()) {
-            CompositeValue compValue = getCompositeValue(inst, this);
+            CompositeValue compValue = (CompositeValue) superPosition.get(inst);
             compValue.getValueClass().setValue(compValue, this, value);
         } else {
             inst.getLIRInstructionClass().setValue(inst, this, value);