8338810: PPC, s390x: LightweightSynchronizer::exit asserts, missing lock

Reviewed-by: mdoerr, amitkumar
This commit is contained in:
Axel Boldt-Christmas 2024-08-23 05:47:29 +00:00
parent ea3370982b
commit e06652ad3c
2 changed files with 12 additions and 2 deletions

@ -2902,7 +2902,11 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(ConditionRegister f
// Check for monitor (0b10).
ld(mark, oopDesc::mark_offset_in_bytes(), obj);
andi_(t, mark, markWord::monitor_value);
bne(CCR0, inflated);
if (!UseObjectMonitorTable) {
bne(CCR0, inflated);
} else {
bne(CCR0, push_and_slow);
}
#ifdef ASSERT
// Check header not unlocked (0b01).

@ -6286,6 +6286,7 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis
BLOCK_COMMENT("compiler_fast_lightweight_unlock {");
{ // Lightweight Unlock
NearLabel push_and_slow_path;
// Check if obj is top of lock-stack.
z_lgf(top, Address(Z_thread, ls_top_offset));
@ -6315,7 +6316,11 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis
// Check for monitor (0b10).
z_lg(mark, Address(obj, mark_offset));
z_tmll(mark, markWord::monitor_value);
z_brnaz(inflated);
if (!UseObjectMonitorTable) {
z_brnaz(inflated);
} else {
z_brnaz(push_and_slow_path);
}
#ifdef ASSERT
// Check header not unlocked (0b01).
@ -6334,6 +6339,7 @@ void MacroAssembler::compiler_fast_unlock_lightweight_object(Register obj, Regis
branch_optimized(Assembler::bcondEqual, unlocked);
}
bind(push_and_slow_path);
// Restore lock-stack and handle the unlock in runtime.
z_lgf(top, Address(Z_thread, ls_top_offset));
DEBUG_ONLY(z_stg(obj, Address(Z_thread, top));)