comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 15832:120a8209389d

Remove overly strict assertion; avoid NullPointerException when canonicalizing invokes without a state
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 20 May 2014 18:56:57 -0700
parents ca19a71c8566
children a750e0d83535
comparison
equal deleted inserted replaced
15831:1ddee372bf62 15832:120a8209389d
135 if (targetMethod.canBeStaticallyBound()) { 135 if (targetMethod.canBeStaticallyBound()) {
136 invokeKind = InvokeKind.Special; 136 invokeKind = InvokeKind.Special;
137 return this; 137 return this;
138 } 138 }
139 139
140 assert targetMethod.getDeclaringClass().asExactType() == null : "should have been handled by canBeStaticallyBound";
141
142 // check if the type of the receiver can narrow the result 140 // check if the type of the receiver can narrow the result
143 ValueNode receiver = receiver(); 141 ValueNode receiver = receiver();
144 ResolvedJavaType type = StampTool.typeOrNull(receiver); 142 ResolvedJavaType type = StampTool.typeOrNull(receiver);
145 if (type != null) { 143 if (type != null && (invoke().stateAfter() != null || invoke().stateDuring() != null)) {
146 // either the holder class is exact, or the receiver object has an exact type 144 // either the holder class is exact, or the receiver object has an exact type
147 ResolvedJavaMethod resolvedMethod = type.resolveMethod(targetMethod, invoke().getContextType()); 145 ResolvedJavaMethod resolvedMethod = type.resolveMethod(targetMethod, invoke().getContextType());
148 if (resolvedMethod != null && (resolvedMethod.canBeStaticallyBound() || StampTool.isExactType(receiver))) { 146 if (resolvedMethod != null && (resolvedMethod.canBeStaticallyBound() || StampTool.isExactType(receiver))) {
149 invokeKind = InvokeKind.Special; 147 invokeKind = InvokeKind.Special;
150 targetMethod = resolvedMethod; 148 targetMethod = resolvedMethod;