# HG changeset patch # User twisti # Date 1346806880 25200 # Node ID d173836037416def60f1f6684a3fbedbd3517a34 # Parent ca11db66f9de1de00414de7b0867c1aeb2559f83 7196120: NPG: JSR 2292 test fails because missing fix for 7188911 Reviewed-by: kvn, coleenp diff -r ca11db66f9de -r d17383603741 src/share/vm/interpreter/linkResolver.cpp --- a/src/share/vm/interpreter/linkResolver.cpp Tue Sep 04 23:27:55 2012 +0200 +++ b/src/share/vm/interpreter/linkResolver.cpp Tue Sep 04 18:01:20 2012 -0700 @@ -1265,7 +1265,7 @@ bootstrap_specifier, method_name, method_signature, &resolved_appendix, - CHECK); + THREAD); if (HAS_PENDING_EXCEPTION) { if (TraceMethodHandles) { tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, PENDING_EXCEPTION); @@ -1282,8 +1282,7 @@ // See the "Linking Exceptions" section for the invokedynamic instruction in the JVMS. Handle nested_exception(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - THROW_MSG_CAUSE(vmSymbols::java_lang_BootstrapMethodError(), - "BootstrapMethodError", nested_exception) + THROW_CAUSE(vmSymbols::java_lang_BootstrapMethodError(), nested_exception) } result.set_handle(resolved_method, resolved_appendix, CHECK); } diff -r ca11db66f9de -r d17383603741 src/share/vm/prims/methodHandles.cpp --- a/src/share/vm/prims/methodHandles.cpp Tue Sep 04 23:27:55 2012 +0200 +++ b/src/share/vm/prims/methodHandles.cpp Tue Sep 04 18:01:20 2012 -0700 @@ -1194,20 +1194,6 @@ } JVM_END -JVM_ENTRY(jobject, MH_invoke_UOE(JNIEnv *env, jobject igmh, jobjectArray igargs)) { - TempNewSymbol UOE_name = SymbolTable::new_symbol("java/lang/UnsupportedOperationException", CHECK_NULL); - THROW_MSG_NULL(UOE_name, "MethodHandle.invoke cannot be invoked reflectively"); - return NULL; -} -JVM_END - -JVM_ENTRY(jobject, MH_invokeExact_UOE(JNIEnv *env, jobject igmh, jobjectArray igargs)) { - TempNewSymbol UOE_name = SymbolTable::new_symbol("java/lang/UnsupportedOperationException", CHECK_NULL); - THROW_MSG_NULL(UOE_name, "MethodHandle.invokeExact cannot be invoked reflectively"); - return NULL; -} -JVM_END - /// JVM_RegisterMethodHandleMethods #undef CS // Solaris builds complain @@ -1245,11 +1231,6 @@ {CC"getMemberVMInfo", CC"("MEM")"OBJ, FN_PTR(MHN_getMemberVMInfo)} }; -static JNINativeMethod invoke_methods[] = { - {CC"invoke", CC"(["OBJ")"OBJ, FN_PTR(MH_invoke_UOE)}, - {CC"invokeExact", CC"(["OBJ")"OBJ, FN_PTR(MH_invokeExact_UOE)} -}; - // This one function is exported, used by NativeLookup. JVM_ENTRY(void, JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass MHN_class)) { @@ -1275,9 +1256,6 @@ ThreadToNativeFromVM ttnfv(thread); status = env->RegisterNatives(MHN_class, required_methods_JDK8, sizeof(required_methods_JDK8)/sizeof(JNINativeMethod)); - if (status == JNI_OK && !env->ExceptionOccurred()) { - status = env->RegisterNatives(MH_class, invoke_methods, sizeof(invoke_methods)/sizeof(JNINativeMethod)); - } if (status != JNI_OK || env->ExceptionOccurred()) { warning("JSR 292 method handle code is mismatched to this JVM. Disabling support."); enable_MH = false; diff -r ca11db66f9de -r d17383603741 src/share/vm/utilities/exceptions.hpp --- a/src/share/vm/utilities/exceptions.hpp Tue Sep 04 23:27:55 2012 +0200 +++ b/src/share/vm/utilities/exceptions.hpp Tue Sep 04 18:01:20 2012 -0700 @@ -235,9 +235,6 @@ #define THROW_ARG(name, signature, args) \ { Exceptions::_throw_args(THREAD_AND_LOCATION, name, signature, args); return; } -#define THROW_MSG_CAUSE(name, message, cause) \ - { Exceptions::_throw_msg_cause(THREAD_AND_LOCATION, name, message, cause); return; } - #define THROW_OOP_(e, result) \ { Exceptions::_throw_oop(THREAD_AND_LOCATION, e); return result; }