Skip to content
Permalink
Browse files
8273489: Zero: Handle UseHeavyMonitors on all monitorenter paths
Backport-of: e3bda63ce29bac0eaea520d42f4927dda77f83f2
  • Loading branch information
shipilev committed Oct 7, 2021
1 parent 9352fa2 commit e1847fca1164e7f3d3bdbe02434d800ce4ff19d5
Showing 1 changed file with 5 additions and 5 deletions.
@@ -332,13 +332,13 @@ int ZeroInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
monitor = (BasicObjectLock*) istate->stack_base();
oop lockee = monitor->obj();
markWord disp = lockee->mark().set_unlocked();

monitor->lock()->set_displaced_header(disp);
if (lockee->cas_set_mark(markWord::from_pointer(monitor), disp) != disp) {
if (thread->is_lock_owned((address) disp.clear_lock_bits().to_pointer())) {
bool call_vm = UseHeavyMonitors;
if (call_vm || lockee->cas_set_mark(markWord::from_pointer(monitor), disp) != disp) {
// Is it simple recursive case?
if (!call_vm && thread->is_lock_owned((address) disp.clear_lock_bits().to_pointer())) {
monitor->lock()->set_displaced_header(markWord::from_pointer(NULL));
}
else {
} else {
CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor));
if (HAS_PENDING_EXCEPTION)
goto unwind_and_return;

1 comment on commit e1847fc

@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.