Skip to content

Commit

Permalink
8300267: Remove duplicated setter/getter for do_not_unlock
Browse files Browse the repository at this point in the history
Reviewed-by: coleenp, dholmes
  • Loading branch information
robehn committed Jan 18, 2023
1 parent 7c8b99e commit d918042
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions 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.
*
Expand Down Expand Up @@ -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
Expand Down

1 comment on commit d918042

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.