1.1 --- a/src/share/vm/ci/ciMethodHandle.cpp Wed Jun 22 14:45:37 2011 -0700 1.2 +++ b/src/share/vm/ci/ciMethodHandle.cpp Thu Jun 23 17:14:06 2011 -0700 1.3 @@ -41,6 +41,16 @@ 1.4 VM_ENTRY_MARK; 1.5 Handle h(get_oop()); 1.6 methodHandle callee(_callee->get_methodOop()); 1.7 + assert(callee->is_method_handle_invoke(), ""); 1.8 + oop mt1 = callee->method_handle_type(); 1.9 + oop mt2 = java_lang_invoke_MethodHandle::type(h()); 1.10 + if (!java_lang_invoke_MethodType::equals(mt1, mt2)) { 1.11 + if (PrintMiscellaneous && (Verbose || WizardMode)) { 1.12 + tty->print_cr("ciMethodHandle::get_adapter: types not equal"); 1.13 + mt1->print(); mt2->print(); 1.14 + } 1.15 + return NULL; 1.16 + } 1.17 // We catch all exceptions here that could happen in the method 1.18 // handle compiler and stop the VM. 1.19 MethodHandleCompiler mhc(h, callee->name(), callee->signature(), _profile.count(), is_invokedynamic, THREAD); 1.20 @@ -53,7 +63,7 @@ 1.21 if (PrintMiscellaneous && (Verbose || WizardMode)) { 1.22 tty->print("*** ciMethodHandle::get_adapter => "); 1.23 PENDING_EXCEPTION->print(); 1.24 - tty->print("*** get_adapter (%s): ", is_invokedynamic ? "indy" : "mh"); ((ciObject*)this)->print(); //@@ 1.25 + tty->print("*** get_adapter (%s): ", is_invokedynamic ? "indy" : "mh"); ((ciObject*)this)->print(); 1.26 } 1.27 CLEAR_PENDING_EXCEPTION; 1.28 return NULL;