--- a/src/hotspot/share/opto/doCall.cpp Tue Sep 03 13:55:41 2019 -0400
+++ b/src/hotspot/share/opto/doCall.cpp Tue Sep 03 17:45:02 2019 +0300
@@ -310,10 +310,12 @@
if (call_does_dispatch && bytecode == Bytecodes::_invokeinterface) {
ciInstanceKlass* declared_interface =
caller->get_declared_method_holder_at_bci(bci)->as_instance_klass();
+ ciInstanceKlass* singleton = declared_interface->unique_implementor();
- if (declared_interface->nof_implementors() == 1 &&
+ if (singleton != NULL &&
(!callee->is_default_method() || callee->is_overpass()) /* CHA doesn't support default methods yet */) {
- ciInstanceKlass* singleton = declared_interface->implementor();
+ assert(singleton != declared_interface, "not a unique implementor");
+
ciMethod* cha_monomorphic_target =
callee->find_monomorphic_target(caller->holder(), declared_interface, singleton);