--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Wed Apr 19 14:37:11 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Thu Dec 01 14:21:31 2016 -0500
@@ -1829,6 +1829,20 @@
log->identify(target),
Bytecodes::name(code));
+ // invoke-special-super
+ if (bc_raw == Bytecodes::_invokespecial && !target->is_object_initializer()) {
+ ciInstanceKlass* sender_klass =
+ calling_klass->is_anonymous() ? calling_klass->host_klass() :
+ calling_klass;
+ if (sender_klass->is_interface()) {
+ int index = state()->stack_size() - (target->arg_size_no_receiver() + 1);
+ Value receiver = state()->stack_at(index);
+ CheckCast* c = new CheckCast(sender_klass, receiver, copy_state_before());
+ c->set_invokespecial_receiver_check();
+ state()->stack_at_put(index, append_split(c));
+ }
+ }
+
// Some methods are obviously bindable without any type checks so
// convert them directly to an invokespecial or invokestatic.
if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) {