# HG changeset patch # User Josef Eisl # Date 1414605272 -3600 # Node ID 839f97696479ca12974150e20b0c0679c4864ac0 # Parent c8d83f6db9a21d6a1ae712bf17c3bd87a475d011 Rename ResolvedJavaMethod.resolvedMethod() to resolveConcreteMethod() the reflect its actual behavior. diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/ResolvedJavaTypeResolveConcreteMethodTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/ResolvedJavaTypeResolveConcreteMethodTest.java Wed Oct 29 18:54:32 2014 +0100 @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.api.meta.test; + +import static org.junit.Assert.*; + +import org.junit.*; + +import com.oracle.graal.api.meta.*; +import com.oracle.graal.api.runtime.*; +import com.oracle.graal.phases.util.*; +import com.oracle.graal.runtime.*; + +public class ResolvedJavaTypeResolveConcreteMethodTest { + public final MetaAccessProvider metaAccess; + + public ResolvedJavaTypeResolveConcreteMethodTest() { + Providers providers = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getProviders(); + metaAccess = providers.getMetaAccess(); + } + + protected abstract static class A { + @SuppressWarnings("unused") + private void priv() { + } + + public void v1() { + } + + public void v2() { + } + + public abstract void abs(); + } + + protected static class B extends A implements I { + public void i() { + } + + @Override + public void v2() { + } + + @Override + public void abs() { + + } + } + + protected static class C extends B { + public void d() { + } + } + + protected abstract static class D extends A { + + } + + protected static class E extends D { + @Override + public void abs() { + } + } + + protected interface I { + void i(); + + default void d() { + } + } + + @Test + public void testDefaultMethod() { + ResolvedJavaType i = getType(I.class); + ResolvedJavaType b = getType(B.class); + ResolvedJavaType c = getType(C.class); + ResolvedJavaMethod di = getMethod(i, "d"); + ResolvedJavaMethod dc = getMethod(c, "d"); + + assertEquals(di, i.resolveConcreteMethod(di, c)); + assertEquals(di, b.resolveConcreteMethod(di, c)); + assertEquals(dc, c.resolveConcreteMethod(di, c)); + } + + @Test + public void testPrivateMethod() { + ResolvedJavaType a = getType(A.class); + ResolvedJavaType b = getType(B.class); + ResolvedJavaType c = getType(C.class); + ResolvedJavaMethod priv = getMethod(a, "priv"); + + assertNull(a.resolveConcreteMethod(priv, c)); + assertNull(b.resolveConcreteMethod(priv, c)); + } + + @Test + public void testAbstractMethod() { + ResolvedJavaType a = getType(A.class); + ResolvedJavaType b = getType(B.class); + ResolvedJavaType c = getType(C.class); + ResolvedJavaType d = getType(D.class); + ResolvedJavaType e = getType(E.class); + ResolvedJavaMethod absa = getMethod(a, "abs"); + ResolvedJavaMethod absb = getMethod(b, "abs"); + ResolvedJavaMethod abse = getMethod(e, "abs"); + + assertNull(a.resolveConcreteMethod(absa, c)); + assertNull(d.resolveConcreteMethod(absa, c)); + + assertEquals(absb, b.resolveConcreteMethod(absa, c)); + assertEquals(absb, b.resolveConcreteMethod(absb, c)); + assertEquals(absb, c.resolveConcreteMethod(absa, c)); + assertEquals(absb, c.resolveConcreteMethod(absb, c)); + assertEquals(abse, e.resolveConcreteMethod(absa, c)); + assertNull(e.resolveConcreteMethod(absb, c)); + assertEquals(abse, e.resolveConcreteMethod(abse, c)); + } + + @Test + public void testVirtualMethod() { + ResolvedJavaType a = getType(A.class); + ResolvedJavaType b = getType(B.class); + ResolvedJavaType c = getType(C.class); + ResolvedJavaMethod v1a = getMethod(a, "v1"); + ResolvedJavaMethod v2a = getMethod(a, "v2"); + ResolvedJavaMethod v2b = getMethod(b, "v2"); + + assertEquals(v1a, a.resolveConcreteMethod(v1a, c)); + assertEquals(v1a, b.resolveConcreteMethod(v1a, c)); + assertEquals(v1a, c.resolveConcreteMethod(v1a, c)); + assertEquals(v2a, a.resolveConcreteMethod(v2a, c)); + assertEquals(v2b, b.resolveConcreteMethod(v2a, c)); + assertEquals(v2b, b.resolveConcreteMethod(v2b, c)); + assertEquals(v2b, c.resolveConcreteMethod(v2a, c)); + assertEquals(v2b, c.resolveConcreteMethod(v2b, c)); + + } + + static ResolvedJavaMethod getMethod(ResolvedJavaType type, String methodName) { + for (ResolvedJavaMethod method : type.getDeclaredMethods()) { + if (method.getName().equals(methodName)) { + return method; + } + } + throw new IllegalArgumentException(); + } + + protected ResolvedJavaType getType(Class clazz) { + ResolvedJavaType type = metaAccess.lookupJavaType(clazz); + type.initialize(); + return type; + } +} diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/ResolvedJavaTypeResolveMethodTest.java --- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/ResolvedJavaTypeResolveMethodTest.java Wed Oct 29 17:16:09 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta.test; - -import static org.junit.Assert.*; - -import org.junit.*; - -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.runtime.*; -import com.oracle.graal.phases.util.*; -import com.oracle.graal.runtime.*; - -public class ResolvedJavaTypeResolveMethodTest { - public final MetaAccessProvider metaAccess; - - public ResolvedJavaTypeResolveMethodTest() { - Providers providers = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getProviders(); - metaAccess = providers.getMetaAccess(); - } - - protected abstract static class A { - @SuppressWarnings("unused") - private void priv() { - } - - public void v1() { - } - - public void v2() { - } - - public abstract void abs(); - } - - protected static class B extends A implements I { - public void i() { - } - - @Override - public void v2() { - } - - @Override - public void abs() { - - } - } - - protected static class C extends B { - public void d() { - } - } - - protected abstract static class D extends A { - - } - - protected static class E extends D { - @Override - public void abs() { - } - } - - protected interface I { - void i(); - - default void d() { - } - } - - @Test - public void testDefaultMethod() { - ResolvedJavaType i = getType(I.class); - ResolvedJavaType b = getType(B.class); - ResolvedJavaType c = getType(C.class); - ResolvedJavaMethod di = getMethod(i, "d"); - ResolvedJavaMethod dc = getMethod(c, "d"); - - assertEquals(di, i.resolveMethod(di, c)); - assertEquals(di, b.resolveMethod(di, c)); - assertEquals(dc, c.resolveMethod(di, c)); - } - - @Test - public void testPrivateMethod() { - ResolvedJavaType a = getType(A.class); - ResolvedJavaType b = getType(B.class); - ResolvedJavaType c = getType(C.class); - ResolvedJavaMethod priv = getMethod(a, "priv"); - - assertNull(a.resolveMethod(priv, c)); - assertNull(b.resolveMethod(priv, c)); - } - - @Test - public void testAbstractMethod() { - ResolvedJavaType a = getType(A.class); - ResolvedJavaType b = getType(B.class); - ResolvedJavaType c = getType(C.class); - ResolvedJavaType d = getType(D.class); - ResolvedJavaType e = getType(E.class); - ResolvedJavaMethod absa = getMethod(a, "abs"); - ResolvedJavaMethod absb = getMethod(b, "abs"); - ResolvedJavaMethod abse = getMethod(e, "abs"); - - assertNull(a.resolveMethod(absa, c)); - assertNull(d.resolveMethod(absa, c)); - - assertEquals(absb, b.resolveMethod(absa, c)); - assertEquals(absb, b.resolveMethod(absb, c)); - assertEquals(absb, c.resolveMethod(absa, c)); - assertEquals(absb, c.resolveMethod(absb, c)); - assertEquals(abse, e.resolveMethod(absa, c)); - assertNull(e.resolveMethod(absb, c)); - assertEquals(abse, e.resolveMethod(abse, c)); - } - - @Test - public void testVirtualMethod() { - ResolvedJavaType a = getType(A.class); - ResolvedJavaType b = getType(B.class); - ResolvedJavaType c = getType(C.class); - ResolvedJavaMethod v1a = getMethod(a, "v1"); - ResolvedJavaMethod v2a = getMethod(a, "v2"); - ResolvedJavaMethod v2b = getMethod(b, "v2"); - - assertEquals(v1a, a.resolveMethod(v1a, c)); - assertEquals(v1a, b.resolveMethod(v1a, c)); - assertEquals(v1a, c.resolveMethod(v1a, c)); - assertEquals(v2a, a.resolveMethod(v2a, c)); - assertEquals(v2b, b.resolveMethod(v2a, c)); - assertEquals(v2b, b.resolveMethod(v2b, c)); - assertEquals(v2b, c.resolveMethod(v2a, c)); - assertEquals(v2b, c.resolveMethod(v2b, c)); - - } - - static ResolvedJavaMethod getMethod(ResolvedJavaType type, String methodName) { - for (ResolvedJavaMethod method : type.getDeclaredMethods()) { - if (method.getName().equals(methodName)) { - return method; - } - } - throw new IllegalArgumentException(); - } - - protected ResolvedJavaType getType(Class clazz) { - ResolvedJavaType type = metaAccess.lookupJavaType(clazz); - type.initialize(); - return type; - } -} diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java --- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java Wed Oct 29 18:54:32 2014 +0100 @@ -529,12 +529,12 @@ } private static void checkResolveMethod(ResolvedJavaType type, ResolvedJavaType context, ResolvedJavaMethod decl, ResolvedJavaMethod expected) { - ResolvedJavaMethod impl = type.resolveMethod(decl, context); + ResolvedJavaMethod impl = type.resolveConcreteMethod(decl, context); assertEquals(expected, impl); } @Test - public void resolveMethodTest() { + public void resolveConcreteMethodTest() { ResolvedJavaType context = metaAccess.lookupJavaType(TestResolvedJavaType.class); for (Class c : classes) { if (c.isInterface() || c.isPrimitive()) { @@ -542,7 +542,7 @@ for (Method m : c.getDeclaredMethods()) { if (JAVA_VERSION <= 1.7D || (!isStatic(m.getModifiers()) && !isPrivate(m.getModifiers()))) { ResolvedJavaMethod resolved = metaAccess.lookupJavaMethod(m); - ResolvedJavaMethod impl = type.resolveMethod(resolved, context); + ResolvedJavaMethod impl = type.resolveConcreteMethod(resolved, context); ResolvedJavaMethod expected = resolved.isDefault() ? resolved : null; assertEquals(m.toString(), expected, impl); } else { @@ -563,7 +563,7 @@ } } for (Method m : c.getDeclaredMethods()) { - ResolvedJavaMethod impl = type.resolveMethod(metaAccess.lookupJavaMethod(m), context); + ResolvedJavaMethod impl = type.resolveConcreteMethod(metaAccess.lookupJavaMethod(m), context); ResolvedJavaMethod expected = isAbstract(m.getModifiers()) ? null : impl; assertEquals(type + " " + m.toString(), expected, impl); } diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Wed Oct 29 18:54:32 2014 +0100 @@ -239,7 +239,7 @@ * @return the concrete method that would be selected at runtime, or {@code null} if there is no * concrete implementation of {@code method} in this type or any of its superclasses */ - ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType); + ResolvedJavaMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType callerType); /** * Given a {@link ResolvedJavaMethod} A, returns a concrete {@link ResolvedJavaMethod} B that is diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Wed Oct 29 18:54:32 2014 +0100 @@ -379,7 +379,7 @@ } @Override - public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType) { + public ResolvedJavaMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType callerType) { ResolvedJavaMethod resolvedMethod = resolveMethodInternal(method, callerType); if (resolvedMethod == null || resolvedMethod.isAbstract()) { return null; diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java Wed Oct 29 18:54:32 2014 +0100 @@ -179,7 +179,7 @@ } @Override - public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType) { + public ResolvedJavaMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType callerType) { return null; } diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java Wed Oct 29 18:54:32 2014 +0100 @@ -96,7 +96,7 @@ * the method */ private Node resolveExactMethod(CanonicalizerTool tool, ResolvedJavaType type) { - ResolvedJavaMethod newMethod = type.resolveMethod(method, type); + ResolvedJavaMethod newMethod = type.resolveConcreteMethod(method, type); if (newMethod == null) { /* * This really represent a misuse of LoadMethod since we're loading from a class which diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Wed Oct 29 18:54:32 2014 +0100 @@ -118,7 +118,7 @@ * either the holder class is exact, or the receiver object has an exact type, or * it's an array type */ - ResolvedJavaMethod resolvedMethod = type.resolveMethod(targetMethod(), invoke().getContextType()); + ResolvedJavaMethod resolvedMethod = type.resolveConcreteMethod(targetMethod(), invoke().getContextType()); if (resolvedMethod != null && (resolvedMethod.canBeStaticallyBound() || StampTool.isExactType(receiver) || type.isArray())) { setInvokeKind(InvokeKind.Special); setTargetMethod(resolvedMethod); @@ -127,7 +127,7 @@ if (tool.assumptions() != null && tool.assumptions().useOptimisticAssumptions()) { ResolvedJavaType uniqueConcreteType = type.findUniqueConcreteSubtype(); if (uniqueConcreteType != null) { - ResolvedJavaMethod methodFromUniqueType = uniqueConcreteType.resolveMethod(targetMethod(), invoke().getContextType()); + ResolvedJavaMethod methodFromUniqueType = uniqueConcreteType.resolveConcreteMethod(targetMethod(), invoke().getContextType()); if (methodFromUniqueType != null) { tool.assumptions().recordConcreteSubtype(type, uniqueConcreteType); setInvokeKind(InvokeKind.Special); diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Wed Oct 29 18:54:32 2014 +0100 @@ -817,7 +817,7 @@ if (receiver != null && (callTarget.invokeKind() == InvokeKind.Interface || callTarget.invokeKind() == InvokeKind.Virtual)) { ResolvedJavaType type = state.getNodeType(receiver); if (!Objects.equals(type, StampTool.typeOrNull(receiver))) { - ResolvedJavaMethod method = type.resolveMethod(callTarget.targetMethod(), invoke.getContextType()); + ResolvedJavaMethod method = type.resolveConcreteMethod(callTarget.targetMethod(), invoke.getContextType()); if (method != null) { if (method.canBeStaticallyBound() || type.isFinal()) { callTarget.setInvokeKind(InvokeKind.Special); diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/FlowSensitiveReduction.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/FlowSensitiveReduction.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/cfs/FlowSensitiveReduction.java Wed Oct 29 18:54:32 2014 +0100 @@ -592,7 +592,7 @@ if (type == null) { return; } - ResolvedJavaMethod method = type.resolveMethod(callTarget.targetMethod(), invoke.getContextType()); + ResolvedJavaMethod method = type.resolveConcreteMethod(callTarget.targetMethod(), invoke.getContextType()); if (method == null) { return; } diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java Wed Oct 29 18:54:32 2014 +0100 @@ -529,9 +529,9 @@ // we have a vtable entry for the interface method and can use a less expensive // virtual call if (!leastCommonType.isInterface() && targetMethod.getDeclaringClass().isAssignableFrom(leastCommonType)) { - ResolvedJavaMethod baseClassTargetMethod = leastCommonType.resolveMethod(targetMethod, contextType); + ResolvedJavaMethod baseClassTargetMethod = leastCommonType.resolveConcreteMethod(targetMethod, contextType); if (baseClassTargetMethod != null) { - devirtualizeWithTypeSwitch(graph, InvokeKind.Virtual, leastCommonType.resolveMethod(targetMethod, contextType), metaAccess); + devirtualizeWithTypeSwitch(graph, InvokeKind.Virtual, leastCommonType.resolveConcreteMethod(targetMethod, contextType), metaAccess); } } } diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Wed Oct 29 18:54:32 2014 +0100 @@ -187,7 +187,7 @@ holder = receiverType; if (receiverStamp.isExactType()) { assert targetMethod.getDeclaringClass().isAssignableFrom(holder) : holder + " subtype of " + targetMethod.getDeclaringClass() + " for " + targetMethod; - ResolvedJavaMethod resolvedMethod = holder.resolveMethod(targetMethod, contextType); + ResolvedJavaMethod resolvedMethod = holder.resolveConcreteMethod(targetMethod, contextType); if (resolvedMethod != null) { return getExactInlineInfo(invoke, resolvedMethod); } @@ -197,7 +197,7 @@ if (holder.isArray()) { // arrays can be treated as Objects - ResolvedJavaMethod resolvedMethod = holder.resolveMethod(targetMethod, contextType); + ResolvedJavaMethod resolvedMethod = holder.resolveConcreteMethod(targetMethod, contextType); if (resolvedMethod != null) { return getExactInlineInfo(invoke, resolvedMethod); } @@ -206,7 +206,7 @@ if (assumptions.useOptimisticAssumptions()) { ResolvedJavaType uniqueSubtype = holder.findUniqueConcreteSubtype(); if (uniqueSubtype != null) { - ResolvedJavaMethod resolvedMethod = uniqueSubtype.resolveMethod(targetMethod, contextType); + ResolvedJavaMethod resolvedMethod = uniqueSubtype.resolveConcreteMethod(targetMethod, contextType); if (resolvedMethod != null) { return getAssumptionInlineInfo(invoke, resolvedMethod, new Assumptions.ConcreteSubtype(holder, uniqueSubtype)); } @@ -249,7 +249,7 @@ ResolvedJavaType type = ptypes[0].getType(); assert type.isArray() || !type.isAbstract(); - ResolvedJavaMethod concrete = type.resolveMethod(targetMethod, contextType); + ResolvedJavaMethod concrete = type.resolveConcreteMethod(targetMethod, contextType); if (!checkTargetConditions(invoke, concrete)) { return null; } @@ -273,7 +273,7 @@ ArrayList concreteMethods = new ArrayList<>(); ArrayList concreteMethodsProbabilities = new ArrayList<>(); for (int i = 0; i < ptypes.length; i++) { - ResolvedJavaMethod concrete = ptypes[i].getType().resolveMethod(targetMethod, contextType); + ResolvedJavaMethod concrete = ptypes[i].getType().resolveConcreteMethod(targetMethod, contextType); if (concrete == null) { InliningUtil.logNotInlined(invoke, inliningDepth(), targetMethod, "could not resolve method"); return null; @@ -320,7 +320,7 @@ ArrayList usedTypes = new ArrayList<>(); ArrayList typesToConcretes = new ArrayList<>(); for (JavaTypeProfile.ProfiledType type : ptypes) { - ResolvedJavaMethod concrete = type.getType().resolveMethod(targetMethod, contextType); + ResolvedJavaMethod concrete = type.getType().resolveConcreteMethod(targetMethod, contextType); int index = concreteMethods.indexOf(concrete); if (index == -1) { notRecordedTypeProbability += type.getProbability(); diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Wed Oct 29 18:54:32 2014 +0100 @@ -186,7 +186,7 @@ Invoke invoke = callTargetNode.invoke(); if (!callTargetNode.isStatic()) { assert callTargetNode.receiver().getKind() == wordKind : "changeToWord() missed the receiver " + callTargetNode.receiver(); - targetMethod = wordImplType.resolveMethod(targetMethod, invoke.getContextType()); + targetMethod = wordImplType.resolveConcreteMethod(targetMethod, invoke.getContextType()); } Operation operation = targetMethod.getAnnotation(Word.Operation.class); assert operation != null : targetMethod; diff -r c8d83f6db9a2 -r 839f97696479 graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeVerificationPhase.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeVerificationPhase.java Wed Oct 29 17:16:09 2014 +0100 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeVerificationPhase.java Wed Oct 29 18:54:32 2014 +0100 @@ -108,7 +108,7 @@ if (!isStatic) { ValueNode receiver = arguments.get(argc); if (receiver == node && isWord(node)) { - ResolvedJavaMethod resolvedMethod = wordAccess.wordImplType.resolveMethod(method, invoke.getContextType()); + ResolvedJavaMethod resolvedMethod = wordAccess.wordImplType.resolveConcreteMethod(method, invoke.getContextType()); verify(resolvedMethod != null, node, invoke.asNode(), "cannot resolve method on Word class: " + method.format("%H.%n(%P) %r")); Operation operation = resolvedMethod.getAnnotation(Word.Operation.class); verify(operation != null, node, invoke.asNode(), "cannot dispatch on word value to non @Operation annotated method " + resolvedMethod);