--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Fri May 12 11:41:05 2017 +0200
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Fri May 12 13:14:25 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -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()) {
@@ -3486,9 +3500,9 @@
case vmIntrinsics::_putLongVolatile : append_unsafe_put_obj(callee, T_LONG, true); return;
case vmIntrinsics::_putFloatVolatile : append_unsafe_put_obj(callee, T_FLOAT, true); return;
case vmIntrinsics::_putDoubleVolatile : append_unsafe_put_obj(callee, T_DOUBLE, true); return;
- case vmIntrinsics::_compareAndSwapLong:
- case vmIntrinsics::_compareAndSwapInt:
- case vmIntrinsics::_compareAndSwapObject: append_unsafe_CAS(callee); return;
+ case vmIntrinsics::_compareAndSetLong:
+ case vmIntrinsics::_compareAndSetInt:
+ case vmIntrinsics::_compareAndSetObject: append_unsafe_CAS(callee); return;
case vmIntrinsics::_getAndAddInt:
case vmIntrinsics::_getAndAddLong : append_unsafe_get_and_set_obj(callee, true); return;
case vmIntrinsics::_getAndSetInt :