mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8247992: [JVMCI] HotSpotNmethod.executeVarargs can try execute a zombie nmethod
Reviewed-by: eosterlund, kvn, never
This commit is contained in:
parent
4167ba1288
commit
6469685285
4 changed files with 40 additions and 34 deletions
|
@ -1025,7 +1025,7 @@ C2V_VMENTRY_NULL(jobject, executeHotSpotNmethod, (JNIEnv* env, jobject, jobject
|
|||
JVMCIObject nmethod_mirror = JVMCIENV->wrap(hs_nmethod);
|
||||
nmethodLocker locker;
|
||||
nmethod* nm = JVMCIENV->get_nmethod(nmethod_mirror, locker);
|
||||
if (nm == NULL) {
|
||||
if (nm == NULL || !nm->is_in_use()) {
|
||||
JVMCI_THROW_NULL(InvalidInstalledCodeException);
|
||||
}
|
||||
methodHandle mh(THREAD, nm->method());
|
||||
|
@ -1034,7 +1034,7 @@ C2V_VMENTRY_NULL(jobject, executeHotSpotNmethod, (JNIEnv* env, jobject, jobject
|
|||
|
||||
JavaArgumentUnboxer jap(signature, &jca, (arrayOop) JNIHandles::resolve(args), mh->is_static());
|
||||
JavaValue result(jap.return_type());
|
||||
jca.set_alternative_target(nm);
|
||||
jca.set_alternative_target(Handle(THREAD, JNIHandles::resolve(nmethod_mirror.as_jobject())));
|
||||
JavaCalls::call(&result, mh, &jca, CHECK_NULL);
|
||||
|
||||
if (jap.return_type() == T_VOID) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue