comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 15722:c583759bbcfd

ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 18 Apr 2014 13:50:15 +0200
parents 820c6d353358
children fa66540676ce
comparison
equal deleted inserted replaced
15721:1e3f19292a32 15722:c583759bbcfd
142 // check if the type of the receiver can narrow the result 142 // check if the type of the receiver can narrow the result
143 ValueNode receiver = receiver(); 143 ValueNode receiver = receiver();
144 ResolvedJavaType type = StampTool.typeOrNull(receiver); 144 ResolvedJavaType type = StampTool.typeOrNull(receiver);
145 if (type != null) { 145 if (type != null) {
146 // either the holder class is exact, or the receiver object has an exact type 146 // either the holder class is exact, or the receiver object has an exact type
147 ResolvedJavaMethod resolvedMethod = type.resolveMethod(targetMethod); 147 ResolvedJavaMethod resolvedMethod = type.resolveMethod(targetMethod, invoke().getContextType());
148 if (resolvedMethod != null && (resolvedMethod.canBeStaticallyBound() || StampTool.isExactType(receiver))) { 148 if (resolvedMethod != null && (resolvedMethod.canBeStaticallyBound() || StampTool.isExactType(receiver))) {
149 invokeKind = InvokeKind.Special; 149 invokeKind = InvokeKind.Special;
150 targetMethod = resolvedMethod; 150 targetMethod = resolvedMethod;
151 return this; 151 return this;
152 } 152 }