Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8264711: More runtime TRAPS cleanups #3345

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/share/jfr/jni/jfrJavaSupport.cpp
Original file line number Diff line number Diff line change
@@ -141,7 +141,7 @@ void JfrJavaSupport::notify_all(jobject object, TRAPS) {
assert(h_obj.not_null(), "invariant");
ObjectSynchronizer::jni_enter(h_obj, THREAD->as_Java_thread());
ObjectSynchronizer::notifyall(h_obj, THREAD);
ObjectSynchronizer::jni_exit(THREAD->as_Java_thread(), h_obj());
ObjectSynchronizer::jni_exit(h_obj(), THREAD);
DEBUG_ONLY(check_java_thread_in_vm(THREAD));
}

2 changes: 1 addition & 1 deletion src/hotspot/share/prims/jni.cpp
Original file line number Diff line number Diff line change
@@ -2735,7 +2735,7 @@ JNI_ENTRY(jint, jni_MonitorExit(JNIEnv *env, jobject jobj))
}

Handle obj(THREAD, JNIHandles::resolve_non_null(jobj));
ObjectSynchronizer::jni_exit(THREAD->as_Java_thread(), obj());
ObjectSynchronizer::jni_exit(obj(), CHECK_(JNI_ERR));

ret = JNI_OK;
return ret;
5 changes: 3 additions & 2 deletions src/hotspot/share/runtime/synchronizer.cpp
Original file line number Diff line number Diff line change
@@ -592,7 +592,8 @@ void ObjectSynchronizer::jni_enter(Handle obj, JavaThread* current) {
}

// NOTE: must use heavy weight monitor to handle jni monitor exit
void ObjectSynchronizer::jni_exit(JavaThread* current, oop obj) {
void ObjectSynchronizer::jni_exit(oop obj, TRAPS) {
JavaThread* current = THREAD->as_Java_thread();
if (UseBiasedLocking) {
Handle h_obj(current, obj);
BiasedLocking::revoke(current, h_obj);
@@ -606,7 +607,7 @@ void ObjectSynchronizer::jni_exit(JavaThread* current, oop obj) {
// If this thread has locked the object, exit the monitor. We
// intentionally do not use CHECK on check_owner because we must exit the
// monitor even if an exception was already pending.
if (monitor->check_owner(current)) {
if (monitor->check_owner(THREAD)) {
monitor->exit(current);
}
}
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/synchronizer.hpp
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ class ObjectSynchronizer : AllStatic {
// Used only to handle jni locks or other unmatched monitor enter/exit
// Internally they will use heavy weight monitor.
static void jni_enter(Handle obj, JavaThread* current);
static void jni_exit(JavaThread* current, oop obj);
static void jni_exit(oop obj, TRAPS);

// Handle all interpreter, compiler and jni cases
static int wait(Handle obj, jlong millis, TRAPS);