Skip to content

Commit e1847fc

Browse files
committed
8273489: Zero: Handle UseHeavyMonitors on all monitorenter paths
Backport-of: e3bda63ce29bac0eaea520d42f4927dda77f83f2
1 parent 9352fa2 commit e1847fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/hotspot/cpu/zero/zeroInterpreter_zero.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,13 @@ int ZeroInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
332332
monitor = (BasicObjectLock*) istate->stack_base();
333333
oop lockee = monitor->obj();
334334
markWord disp = lockee->mark().set_unlocked();
335-
336335
monitor->lock()->set_displaced_header(disp);
337-
if (lockee->cas_set_mark(markWord::from_pointer(monitor), disp) != disp) {
338-
if (thread->is_lock_owned((address) disp.clear_lock_bits().to_pointer())) {
336+
bool call_vm = UseHeavyMonitors;
337+
if (call_vm || lockee->cas_set_mark(markWord::from_pointer(monitor), disp) != disp) {
338+
// Is it simple recursive case?
339+
if (!call_vm && thread->is_lock_owned((address) disp.clear_lock_bits().to_pointer())) {
339340
monitor->lock()->set_displaced_header(markWord::from_pointer(NULL));
340-
}
341-
else {
341+
} else {
342342
CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor));
343343
if (HAS_PENDING_EXCEPTION)
344344
goto unwind_and_return;

0 commit comments

Comments
 (0)