src/hotspot/share/c1/c1_GraphBuilder.cpp
changeset 57996 bf3fb5465543
parent 54721 3661ad97da8f
child 58004 dee322336e17
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp	Tue Sep 03 13:55:41 2019 -0400
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp	Tue Sep 03 17:45:02 2019 +0300
@@ -1957,12 +1957,11 @@
       // number of implementors for decl_interface is 0 or 1. If
       // it's 0 then no class implements decl_interface and there's
       // no point in inlining.
-      ciInstanceKlass* singleton = NULL;
       ciInstanceKlass* declared_interface = callee_holder;
-      if (declared_interface->nof_implementors() == 1 &&
-          (!target->is_default_method() || target->is_overpass()) /* CHA doesn't support default methods yet. */) {
-        singleton = declared_interface->implementor();
-        assert(singleton != NULL && singleton != declared_interface, "");
+      ciInstanceKlass* singleton = declared_interface->unique_implementor();
+      if (singleton != NULL &&
+          (!target->is_default_method() || target->is_overpass()) /* CHA doesn't support default methods yet. */ ) {
+        assert(singleton != declared_interface, "not a unique implementor");
         cha_monomorphic_target = target->find_monomorphic_target(calling_klass, declared_interface, singleton);
         if (cha_monomorphic_target != NULL) {
           if (cha_monomorphic_target->holder() != compilation()->env()->Object_klass()) {