--- old/src/share/vm/runtime/sharedRuntime.cpp 2017-06-27 11:14:31.455558345 +0200 +++ new/src/share/vm/runtime/sharedRuntime.cpp 2017-06-27 11:14:31.363558349 +0200 @@ -1136,6 +1136,10 @@ } } else { assert(ValueTypePassFieldsAsArgs, "invalid use of attached methods"); + if (bc != Bytecodes::_invokevirtual) { + // Ignore the attached method in this case to not confuse below code + attached_method = NULL; + } } } @@ -2721,6 +2725,8 @@ assert(k != NULL && !HAS_PENDING_EXCEPTION, "can resolve klass?"); ValueKlass* vk = ValueKlass::cast(k); if (vk == SystemDictionary::___Value_klass()) { + assert(method->is_compiled_lambda_form() || method->is_method_handle_intrinsic(), + "should not use __Value for a value type argument"); sig_extended.push(SigEntry(T_OBJECT)); } else { const GrowableArray& sig_vk = vk->collect_fields();