# HG changeset patch # User Christian Haeubl # Date 1355493222 -3600 # Node ID c0806f4ff3ea3d901df307475bc141c1c694636f # Parent 762717d2cf901aeb0fa7f4192b8bc5ca5971e379 avoid searching for concrete methods on interfaces diff -r 762717d2cf90 -r c0806f4ff3ea graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java Fri Dec 14 14:39:50 2012 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java Fri Dec 14 14:53:42 2012 +0100 @@ -91,7 +91,7 @@ assertInlined(getGraph("invokeLeafClassMethodSnippet")); assertInlined(getGraph("invokeConcreteMethodSnippet")); assertInlined(getGraph("invokeSingleImplementorInterfaceSnippet")); - assertInlined(getGraph("invokeConcreteInterfaceMethodSnippet")); +// assertInlined(getGraph("invokeConcreteInterfaceMethodSnippet")); assertNotInlined(getGraph("invokeOverriddenInterfaceMethodSnippet")); } diff -r 762717d2cf90 -r c0806f4ff3ea src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Fri Dec 14 14:39:50 2012 +0100 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Fri Dec 14 14:53:42 2012 +0100 @@ -224,17 +224,16 @@ C2V_VMENTRY(jlong, getUniqueConcreteMethod, (JNIEnv *, jobject, jlong metaspace_method, jobject resultHolder)) methodHandle method = asMethod(metaspace_method); KlassHandle holder = method->method_holder(); - // TODO (chaeubl): check if the following is necessary - //if (holder->is_interface()) { - // // Cannot trust interfaces. Because of: - // // interface I { void foo(); } - // // class A { public void foo() {} } - // // class B extends A implements I { } - // // class C extends B { public void foo() { } } - // // class D extends B { } - // // Would lead to identify C.foo() as the unique concrete method for I.foo() without seeing A.foo(). - // return 0L; - //} + if (holder->is_interface()) { + // Cannot trust interfaces. Because of: + // interface I { void foo(); } + // class A { public void foo() {} } + // class B extends A implements I { } + // class C extends B { public void foo() { } } + // class D extends B { } + // Would lead to identify C.foo() as the unique concrete method for I.foo() without seeing A.foo(). + return 0L; + } methodHandle ucm; { ResourceMark rm;