diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp index 7d8ab5110cf91..7979eb3ec2382 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp @@ -604,7 +604,7 @@ void BytecodeInterpreter::run(interpreterState istate) { return; } case method_entry: { - THREAD->set_do_not_unlock(); + THREAD->set_do_not_unlock_if_synchronized(true); // Lock method if synchronized. if (METHOD->is_synchronized()) { @@ -639,7 +639,7 @@ void BytecodeInterpreter::run(interpreterState istate) { THREAD->inc_held_monitor_count(); } } - THREAD->clr_do_not_unlock(); + THREAD->set_do_not_unlock_if_synchronized(false); // Notify jvmti. // Whenever JVMTI puts a thread in interp_only_mode, method @@ -3098,12 +3098,12 @@ void BytecodeInterpreter::run(interpreterState istate) { // there is no need to unlock it (or look for other monitors), since that // could not have happened. - if (THREAD->do_not_unlock()) { + if (THREAD->do_not_unlock_if_synchronized()) { // Never locked, reset the flag now because obviously any caller must // have passed their point of locking for us to have gotten here. - THREAD->clr_do_not_unlock(); + THREAD->set_do_not_unlock_if_synchronized(false); } else { // At this point we consider that we have returned. We now check that the // locks were properly block structured. If we find that they were not @@ -3229,7 +3229,7 @@ void BytecodeInterpreter::run(interpreterState istate) { } } // Clear the do_not_unlock flag now. - THREAD->clr_do_not_unlock(); + THREAD->set_do_not_unlock_if_synchronized(false); // // Notify jvmti/jvmdi diff --git a/src/hotspot/share/runtime/javaThread.hpp b/src/hotspot/share/runtime/javaThread.hpp index 1bd503b107bed..ff1d04164f0ca 100644 --- a/src/hotspot/share/runtime/javaThread.hpp +++ b/src/hotspot/share/runtime/javaThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, Azul Systems, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -741,10 +741,6 @@ class JavaThread: public Thread { } // Misc. accessors/mutators - void set_do_not_unlock(void) { _do_not_unlock_if_synchronized = true; } - void clr_do_not_unlock(void) { _do_not_unlock_if_synchronized = false; } - bool do_not_unlock(void) { return _do_not_unlock_if_synchronized; } - static ByteSize scopedValueCache_offset() { return byte_offset_of(JavaThread, _scopedValueCache); } // For assembly stub generation