mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
7196120: NPG: JSR 2292 test fails because missing fix for 7188911
Reviewed-by: kvn, coleenp
This commit is contained in:
parent
badaff577b
commit
0f2dd1c15e
3 changed files with 2 additions and 28 deletions
|
@ -1265,7 +1265,7 @@ void LinkResolver::resolve_dynamic_call(CallInfo& result,
|
||||||
bootstrap_specifier,
|
bootstrap_specifier,
|
||||||
method_name, method_signature,
|
method_name, method_signature,
|
||||||
&resolved_appendix,
|
&resolved_appendix,
|
||||||
CHECK);
|
THREAD);
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
if (TraceMethodHandles) {
|
if (TraceMethodHandles) {
|
||||||
tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, PENDING_EXCEPTION);
|
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.
|
// See the "Linking Exceptions" section for the invokedynamic instruction in the JVMS.
|
||||||
Handle nested_exception(THREAD, PENDING_EXCEPTION);
|
Handle nested_exception(THREAD, PENDING_EXCEPTION);
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
THROW_MSG_CAUSE(vmSymbols::java_lang_BootstrapMethodError(),
|
THROW_CAUSE(vmSymbols::java_lang_BootstrapMethodError(), nested_exception)
|
||||||
"BootstrapMethodError", nested_exception)
|
|
||||||
}
|
}
|
||||||
result.set_handle(resolved_method, resolved_appendix, CHECK);
|
result.set_handle(resolved_method, resolved_appendix, CHECK);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1194,20 +1194,6 @@ JVM_ENTRY(void, MHN_setCallSiteTargetVolatile(JNIEnv* env, jobject igcls, jobjec
|
||||||
}
|
}
|
||||||
JVM_END
|
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
|
/// JVM_RegisterMethodHandleMethods
|
||||||
|
|
||||||
#undef CS // Solaris builds complain
|
#undef CS // Solaris builds complain
|
||||||
|
@ -1245,11 +1231,6 @@ static JNINativeMethod required_methods_JDK8[] = {
|
||||||
{CC"getMemberVMInfo", CC"("MEM")"OBJ, FN_PTR(MHN_getMemberVMInfo)}
|
{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.
|
// This one function is exported, used by NativeLookup.
|
||||||
|
|
||||||
JVM_ENTRY(void, JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass MHN_class)) {
|
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);
|
ThreadToNativeFromVM ttnfv(thread);
|
||||||
|
|
||||||
status = env->RegisterNatives(MHN_class, required_methods_JDK8, sizeof(required_methods_JDK8)/sizeof(JNINativeMethod));
|
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()) {
|
if (status != JNI_OK || env->ExceptionOccurred()) {
|
||||||
warning("JSR 292 method handle code is mismatched to this JVM. Disabling support.");
|
warning("JSR 292 method handle code is mismatched to this JVM. Disabling support.");
|
||||||
enable_MH = false;
|
enable_MH = false;
|
||||||
|
|
|
@ -235,9 +235,6 @@ class Exceptions {
|
||||||
#define THROW_ARG(name, signature, args) \
|
#define THROW_ARG(name, signature, args) \
|
||||||
{ Exceptions::_throw_args(THREAD_AND_LOCATION, name, signature, args); return; }
|
{ 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) \
|
#define THROW_OOP_(e, result) \
|
||||||
{ Exceptions::_throw_oop(THREAD_AND_LOCATION, e); return result; }
|
{ Exceptions::_throw_oop(THREAD_AND_LOCATION, e); return result; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue