Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8223050

JVMCI: findUniqueConcreteMethod() should not use Dependencies::find_unique_concrete_method() for non-virtual methods

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b25

      Backports

        Description

        Dependencies::find_unique_concrete_method() doesn't filter out non-virtual (static & private) methods. For C1/C2, the proper checks happen in ciMethod::find_monomorphic_target(), but JVMCI doesn't have them.

        Non-virtual methods are problematic because ClassHierarchyWalker operates on symbolic info when looking for overrides.

        With the following patch compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java hits the assert:
        diff --git a/src/hotspot/share/code/dependencies.cpp b/src/hotspot/share/code/dependencies.cpp
        --- a/src/hotspot/share/code/dependencies.cpp
        +++ b/src/hotspot/share/code/dependencies.cpp
        @@ -1099,6 +1099,7 @@
         
           void initialize_from_method(Method* m) {
             assert(m != NULL && m->is_method(), "sanity");
        + assert(!m->is_static() && !m->is_private(), "sanity");
             _name = m->name();
             _signature = m->signature();
           }

        ----------System.out:(28/2434)----------
        CASE: receiver=compiler.jvmci.common.testcases.SingleSubclass, holder=compiler.jvmci.common.testcases.SingleSubclass, method=overridenMethod, isPositive=true
        CASE: receiver=compiler.jvmci.common.testcases.SingleSubclass, holder=compiler.jvmci.common.testcases.SingleSubclass, method=protectedMethod, isPositive=true
        CASE: receiver=compiler.jvmci.common.testcases.MultipleImplementer1, holder=compiler.jvmci.common.testcases.MultipleImplementer1, method=testMethod, isPositive=true
        CASE: receiver=compiler.jvmci.common.testcases.SingleSubclass, holder=compiler.jvmci.common.testcases.SingleSubclass, method=usualMethod, isPositive=true
        CASE: receiver=compiler.jvmci.common.testcases.SingleSubclass, holder=compiler.jvmci.common.testcases.SingleSubclass, method=defaultAccessMethod, isPositive=true
        CASE: receiver=compiler.jvmci.common.testcases.MultipleSuperImplementers, holder=compiler.jvmci.common.testcases.SimpleSingleImplementerInterface, method=interfaceMethod, isPositive=false
        CASE: receiver=compiler.jvmci.common.testcases.MultipleSuperImplementers, holder=compiler.jvmci.common.testcases. DuplicateSimpleSingleImplementerInterface, method=interfaceMethod, isPositive=false
        CASE: receiver=compiler.jvmci.common.testcases.SingleSubclass, holder=compiler.jvmci.common.testcases.SingleSubclass, method=privateMethod, isPositive=true
        # To suppress the following error report, specify this argument
        # after -XX: or in .hotspotrc: SuppressErrorAt=/dependencies.cpp:1102
        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/Users/vlivanov/ws/jdk/open/jdk/src/hotspot/share/code/dependencies.cpp:1102), pid=4536, tid=39939
        # assert(!m->is_static() && !m->is_private()) failed: sanity
        #
        # JRE version: OpenJDK Runtime Environment (13.0) (slowdebug build 13-internal+0-adhoc.vlivanov.jdk)
        # Java VM: OpenJDK 64-Bit Server VM (slowdebug 13-internal+0-adhoc.vlivanov.jdk, mixed mode, tiered, jvmci, compressed oops, g1 gc, bsd-amd64)

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dlong Dean Long
                Reporter:
                vlivanov Vladimir Ivanov
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: