70 71 AllocatableValue baseValue = base == null ? Value.ILLEGAL : tool.asAllocatable(gen.operand(base)); 72 AllocatableValue indexValue = index == null ? Value.ILLEGAL : tool.asAllocatable(gen.operand(index)); 73 74 AllocatableValue baseReference = LIRKind.derivedBaseFromValue(baseValue); 75 AllocatableValue indexReference; 76 if (scale.equals(Scale.Times1)) { 77 indexReference = LIRKind.derivedBaseFromValue(indexValue); 78 } else { 79 if (LIRKind.isValue(indexValue)) { 80 indexReference = null; 81 } else { 82 indexReference = Value.ILLEGAL; 83 } 84 } 85 86 LIRKind kind = LIRKind.combineDerived(tool.getLIRKind(stamp()), baseReference, indexReference); 87 gen.setResult(this, new AMD64AddressValue(kind, baseValue, indexValue, scale, displacement)); 88 } 89 90 public ValueNode getBase() { 91 return base; 92 } 93 94 public void setBase(ValueNode base) { 95 // allow modification before inserting into the graph 96 if (isAlive()) { 97 updateUsages(this.base, base); 98 } 99 this.base = base; 100 } 101 102 public ValueNode getIndex() { 103 return index; 104 } 105 106 public void setIndex(ValueNode index) { 107 // allow modification before inserting into the graph 108 if (isAlive()) { 109 updateUsages(this.index, index); 110 } 111 this.index = index; 112 } 113 114 public Scale getScale() { 115 return scale; 116 } 117 118 public void setScale(Scale scale) { 119 this.scale = scale; 120 } 121 122 public int getDisplacement() { 123 return displacement; 124 } 125 126 public void setDisplacement(int displacement) { 127 this.displacement = displacement; 128 } 129 } | 70 71 AllocatableValue baseValue = base == null ? Value.ILLEGAL : tool.asAllocatable(gen.operand(base)); 72 AllocatableValue indexValue = index == null ? Value.ILLEGAL : tool.asAllocatable(gen.operand(index)); 73 74 AllocatableValue baseReference = LIRKind.derivedBaseFromValue(baseValue); 75 AllocatableValue indexReference; 76 if (scale.equals(Scale.Times1)) { 77 indexReference = LIRKind.derivedBaseFromValue(indexValue); 78 } else { 79 if (LIRKind.isValue(indexValue)) { 80 indexReference = null; 81 } else { 82 indexReference = Value.ILLEGAL; 83 } 84 } 85 86 LIRKind kind = LIRKind.combineDerived(tool.getLIRKind(stamp()), baseReference, indexReference); 87 gen.setResult(this, new AMD64AddressValue(kind, baseValue, indexValue, scale, displacement)); 88 } 89 90 @Override 91 public ValueNode getBase() { 92 return base; 93 } 94 95 public void setBase(ValueNode base) { 96 // allow modification before inserting into the graph 97 if (isAlive()) { 98 updateUsages(this.base, base); 99 } 100 this.base = base; 101 } 102 103 @Override 104 public ValueNode getIndex() { 105 return index; 106 } 107 108 public void setIndex(ValueNode index) { 109 // allow modification before inserting into the graph 110 if (isAlive()) { 111 updateUsages(this.index, index); 112 } 113 this.index = index; 114 } 115 116 public Scale getScale() { 117 return scale; 118 } 119 120 public void setScale(Scale scale) { 121 this.scale = scale; 122 } 123 124 public int getDisplacement() { 125 return displacement; 126 } 127 128 public void setDisplacement(int displacement) { 129 this.displacement = displacement; 130 } 131 132 @Override 133 public long getMaxConstantDisplacement() { 134 return displacement; 135 } 136 } |