comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java @ 5473:c73882b7db10

runtime may be null in the canonicalizer (like target or assumptions)
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 31 May 2012 17:57:21 +0200
parents 141817e206d4
children d89b20486d87
comparison
equal deleted inserted replaced
5453:071f24ba116e 5473:c73882b7db10
53 } 53 }
54 } 54 }
55 55
56 @Override 56 @Override
57 public ValueNode canonical(CanonicalizerTool tool) { 57 public ValueNode canonical(CanonicalizerTool tool) {
58 CiConstant constant = null; 58 RiRuntime runtime = tool.runtime();
59 if (isStatic()) { 59 if (runtime != null) {
60 constant = field().constantValue(null); 60 CiConstant constant = null;
61 } else if (object().isConstant() && !object().isNullConstant()) { 61 if (isStatic()) {
62 constant = field().constantValue(object().asConstant()); 62 constant = field().constantValue(null);
63 } 63 } else if (object().isConstant() && !object().isNullConstant()) {
64 if (constant != null) { 64 constant = field().constantValue(object().asConstant());
65 return ConstantNode.forCiConstant(constant, tool.runtime(), graph()); 65 }
66 if (constant != null) {
67 return ConstantNode.forCiConstant(constant, runtime, graph());
68 }
66 } 69 }
67 return this; 70 return this;
68 } 71 }
69 } 72 }