--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp Mon May 06 14:47:55 2019 -0400
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp Mon May 06 12:15:49 2019 -0700
@@ -1988,8 +1988,9 @@
}
if (cha_monomorphic_target != NULL) {
+ assert(!target->can_be_statically_bound() || target == cha_monomorphic_target, "");
assert(!cha_monomorphic_target->is_abstract(), "");
- if (!target->is_final_method() && !target->is_private()) {
+ if (!cha_monomorphic_target->can_be_statically_bound(actual_recv)) {
// If we inlined because CHA revealed only a single target method,
// then we are dependent on that target method not getting overridden
// by dynamic class loading. Be sure to test the "static" receiver