--- old/src/share/vm/opto/callGenerator.cpp 2016-02-09 11:51:42.102643919 +0100 +++ new/src/share/vm/opto/callGenerator.cpp 2016-02-09 11:51:42.034643916 +0100 @@ -867,17 +867,18 @@ } } // Cast reference arguments to its type. - for (int i = 0; i < signature->count(); i++) { + for (int i = 0, j = 0; i < signature->count(); i++) { ciType* t = signature->type_at(i); if (t->is_klass()) { - Node* arg = kit.argument(receiver_skip + i); + Node* arg = kit.argument(receiver_skip + j); const TypeOopPtr* arg_type = arg->bottom_type()->isa_oopptr(); const Type* sig_type = TypeOopPtr::make_from_klass(t->as_klass()); if (arg_type != NULL && !arg_type->higher_equal(sig_type)) { Node* cast_obj = gvn.transform(new CheckCastPPNode(kit.control(), arg, sig_type)); - kit.set_argument(receiver_skip + i, cast_obj); + kit.set_argument(receiver_skip + j, cast_obj); } } + j += t->size(); // long and double take two slots } // Try to get the most accurate receiver type