diff src/share/vm/runtime/sharedRuntime.cpp @ 3781:d83ac25d0304

7055355: JSR 292: crash while throwing WrongMethodTypeException Reviewed-by: jrose, twisti, bdelsart
author never
date Thu, 16 Jun 2011 13:46:55 -0700
parents cba7b5c2d53f
children be4ca325525a 0f34fdee809e
line wrap: on
line diff
--- a/src/share/vm/runtime/sharedRuntime.cpp	Wed Jun 15 10:20:03 2011 -0700
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Thu Jun 16 13:46:55 2011 -0700
@@ -763,6 +763,13 @@
   throw_and_post_jvmti_exception(thread, exception);
 JRT_END
 
+JRT_ENTRY(void, SharedRuntime::throw_WrongMethodTypeException(JavaThread* thread, oopDesc* required, oopDesc* actual))
+  assert(thread == JavaThread::current() && required->is_oop() && actual->is_oop(), "bad args");
+  ResourceMark rm;
+  char* message = SharedRuntime::generate_wrong_method_type_message(thread, required, actual);
+  throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_invoke_WrongMethodTypeException(), message);
+JRT_END
+
 address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread,
                                                            address pc,
                                                            SharedRuntime::ImplicitExceptionKind exception_kind)