From 30b432119191ee26ed9296e5c4a4f39715547150 Mon Sep 17 00:00:00 2001 From: twisti Date: Tue, 4 Sep 2012 18:01:20 -0700 Subject: [PATCH] 7196120: NPG: JSR 2292 test fails because missing fix for 7188911 Reviewed-by: kvn, coleenp --- src/share/vm/interpreter/linkResolver.cpp | 5 ++--- src/share/vm/prims/methodHandles.cpp | 22 ---------------------- src/share/vm/utilities/exceptions.hpp | 3 --- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/share/vm/interpreter/linkResolver.cpp b/src/share/vm/interpreter/linkResolver.cpp index a11f02797..50a2a21a4 100644 --- a/src/share/vm/interpreter/linkResolver.cpp +++ b/src/share/vm/interpreter/linkResolver.cpp @@ -1265,7 +1265,7 @@ void LinkResolver::resolve_dynamic_call(CallInfo& result, 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 @@ void LinkResolver::resolve_dynamic_call(CallInfo& result, // 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 --git a/src/share/vm/prims/methodHandles.cpp b/src/share/vm/prims/methodHandles.cpp index b0d513619..98d379b67 100644 --- a/src/share/vm/prims/methodHandles.cpp +++ b/src/share/vm/prims/methodHandles.cpp @@ -1194,20 +1194,6 @@ JVM_ENTRY(void, MHN_setCallSiteTargetVolatile(JNIEnv* env, jobject igcls, jobjec } 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 @@ static JNINativeMethod required_methods_JDK8[] = { {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 @@ JVM_ENTRY(void, JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass MHN_class)) 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 --git a/src/share/vm/utilities/exceptions.hpp b/src/share/vm/utilities/exceptions.hpp index bf48f8159..740912d39 100644 --- a/src/share/vm/utilities/exceptions.hpp +++ b/src/share/vm/utilities/exceptions.hpp @@ -235,9 +235,6 @@ class Exceptions { #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; } -- GitLab