# HG changeset patch # User Josef Eisl # Date 1403777012 -7200 # Node ID 90046b8aae8a859f41d9057359a96c4cad0c28cc # Parent 95e147b30dd058cf13e955698697844e92ae9e2c Fix ValuePosition recursive lookup issue for CompositeValues. diff -r 95e147b30dd0 -r 90046b8aae8a graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValuePosition.java --- 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 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);