< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CompressionNode.java
Print this page
@@ -120,13 +120,13 @@
if (forValue.isConstant()) {
if (GeneratePIC.getValue(tool.getOptions())) {
// We always want uncompressed constants
return this;
}
- int stableDimension = ((ConstantNode) forValue).getStableDimension();
- boolean isDefaultStable = ((ConstantNode) forValue).isDefaultStable();
- return ConstantNode.forConstant(stamp(), convert(forValue.asConstant(), tool.getConstantReflection()), stableDimension, isDefaultStable, tool.getMetaAccess());
+
+ ConstantNode constant = (ConstantNode) forValue;
+ return ConstantNode.forConstant(stamp(), convert(constant.getValue(), tool.getConstantReflection()), constant.getStableDimension(), constant.isDefaultStable(), tool.getMetaAccess());
} else if (forValue instanceof CompressionNode) {
CompressionNode other = (CompressionNode) forValue;
if (op != other.op && encoding.equals(other.encoding)) {
return other.getValue();
}
@@ -134,26 +134,26 @@
return this;
}
@Override
public void generate(NodeLIRBuilderTool gen) {
- LIRGeneratorTool hsGen = gen.getLIRGeneratorTool();
boolean nonNull;
- if (getValue().stamp() instanceof AbstractObjectStamp) {
- nonNull = StampTool.isPointerNonNull(getValue().stamp());
+ if (value.stamp() instanceof AbstractObjectStamp) {
+ nonNull = StampTool.isPointerNonNull(value.stamp());
} else {
// metaspace pointers are never null
nonNull = true;
}
+ LIRGeneratorTool tool = gen.getLIRGeneratorTool();
Value result;
switch (op) {
case Compress:
- result = hsGen.emitCompress(gen.operand(getValue()), encoding, nonNull);
+ result = tool.emitCompress(gen.operand(value), encoding, nonNull);
break;
case Uncompress:
- result = hsGen.emitUncompress(gen.operand(getValue()), encoding, nonNull);
+ result = tool.emitUncompress(gen.operand(value), encoding, nonNull);
break;
default:
throw GraalError.shouldNotReachHere();
}
< prev index next >