mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-12 19:35:24 +00:00
8316935: [s390x] Use consistent naming for lightweight locking in MacroAssembler
Reviewed-by: mdoerr, lucy
This commit is contained in:
parent
4e1e579e8b
commit
efb7e85ecf
@ -107,7 +107,7 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox
|
||||
assert(LockingMode != LM_MONITOR, "LM_MONITOR is already handled, by emit_lock()");
|
||||
|
||||
if (LockingMode == LM_LIGHTWEIGHT) {
|
||||
fast_lock(Roop, Rmark, tmp, slow_case);
|
||||
lightweight_lock(Roop, Rmark, tmp, slow_case);
|
||||
} else if (LockingMode == LM_LEGACY) {
|
||||
NearLabel done;
|
||||
// and mark it as unlocked.
|
||||
@ -171,7 +171,7 @@ void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rb
|
||||
z_lgr(tmp, Rmark);
|
||||
z_nill(tmp, markWord::monitor_value);
|
||||
z_brnz(slow_case);
|
||||
fast_unlock(Roop, Rmark, tmp, slow_case);
|
||||
lightweight_unlock(Roop, Rmark, tmp, slow_case);
|
||||
} else if (LockingMode == LM_LEGACY) {
|
||||
// Test if object header is pointing to the displaced header, and if so, restore
|
||||
// the displaced header in the object. If the object header is not pointing to
|
||||
|
||||
@ -1030,7 +1030,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
|
||||
}
|
||||
|
||||
if (LockingMode == LM_LIGHTWEIGHT) {
|
||||
fast_lock(object, /* mark word */ header, tmp, slow_case);
|
||||
lightweight_lock(object, /* mark word */ header, tmp, slow_case);
|
||||
} else if (LockingMode == LM_LEGACY) {
|
||||
|
||||
// Set header to be (markWord of object | UNLOCK_VALUE).
|
||||
@ -1088,7 +1088,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
|
||||
// slow case of monitor enter.
|
||||
bind(slow_case);
|
||||
if (LockingMode == LM_LIGHTWEIGHT) {
|
||||
// for fast locking we need to use monitorenter_obj, see interpreterRuntime.cpp
|
||||
// for lightweight locking we need to use monitorenter_obj, see interpreterRuntime.cpp
|
||||
call_VM(noreg,
|
||||
CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter_obj),
|
||||
object);
|
||||
@ -1187,7 +1187,7 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, Register object)
|
||||
z_nill(tmp, markWord::monitor_value);
|
||||
z_brne(slow_case);
|
||||
|
||||
fast_unlock(object, header, tmp, slow_case);
|
||||
lightweight_unlock(object, header, tmp, slow_case);
|
||||
|
||||
z_bru(done);
|
||||
} else {
|
||||
|
||||
@ -3205,7 +3205,7 @@ void MacroAssembler::compiler_fast_lock_object(Register oop, Register box, Regis
|
||||
z_bru(done);
|
||||
} else {
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "must be");
|
||||
fast_lock(oop, displacedHeader, temp, done);
|
||||
lightweight_lock(oop, displacedHeader, temp, done);
|
||||
z_bru(done);
|
||||
}
|
||||
|
||||
@ -3285,7 +3285,7 @@ void MacroAssembler::compiler_fast_unlock_object(Register oop, Register box, Reg
|
||||
// don't load currentHead again from stack-top after monitor check, as it is possible
|
||||
// some other thread modified it.
|
||||
// currentHeader is altered, but it's contents are copied in temp as well
|
||||
fast_unlock(oop, temp, currentHeader, done);
|
||||
lightweight_unlock(oop, temp, currentHeader, done);
|
||||
z_bru(done);
|
||||
}
|
||||
|
||||
@ -5645,14 +5645,14 @@ SkipIfEqual::~SkipIfEqual() {
|
||||
_masm->bind(_label);
|
||||
}
|
||||
|
||||
// Implements fast-locking.
|
||||
// Implements lightweight-locking.
|
||||
// Branches to slow upon failure to lock the object.
|
||||
// Falls through upon success.
|
||||
//
|
||||
// - obj: the object to be locked, contents preserved.
|
||||
// - hdr: the header, already loaded from obj, contents destroyed.
|
||||
// Note: make sure Z_R1 is not manipulated here when C2 compiler is in play
|
||||
void MacroAssembler::fast_lock(Register obj, Register hdr, Register temp, Label& slow_case) {
|
||||
void MacroAssembler::lightweight_lock(Register obj, Register hdr, Register temp, Label& slow_case) {
|
||||
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "only used with new lightweight locking");
|
||||
assert_different_registers(obj, hdr, temp);
|
||||
@ -5662,7 +5662,7 @@ void MacroAssembler::fast_lock(Register obj, Register hdr, Register temp, Label&
|
||||
|
||||
compareU32_and_branch(temp, (unsigned)LockStack::end_offset()-1, bcondHigh, slow_case);
|
||||
|
||||
// attempting a fast_lock
|
||||
// attempting a lightweight_lock
|
||||
// Load (object->mark() | 1) into hdr
|
||||
z_oill(hdr, markWord::unlocked_value);
|
||||
|
||||
@ -5684,26 +5684,26 @@ void MacroAssembler::fast_lock(Register obj, Register hdr, Register temp, Label&
|
||||
z_cr(temp, temp);
|
||||
}
|
||||
|
||||
// Implements fast-unlocking.
|
||||
// Implements lightweight-unlocking.
|
||||
// Branches to slow upon failure.
|
||||
// Falls through upon success.
|
||||
//
|
||||
// - obj: the object to be unlocked
|
||||
// - hdr: the (pre-loaded) header of the object, will be destroyed
|
||||
// - Z_R1_scratch: will be killed in case of Interpreter & C1 Compiler
|
||||
void MacroAssembler::fast_unlock(Register obj, Register hdr, Register tmp, Label& slow) {
|
||||
void MacroAssembler::lightweight_unlock(Register obj, Register hdr, Register tmp, Label& slow) {
|
||||
|
||||
assert(LockingMode == LM_LIGHTWEIGHT, "only used with new lightweight locking");
|
||||
assert_different_registers(obj, hdr, tmp);
|
||||
|
||||
#ifdef ASSERT
|
||||
{
|
||||
// Check that hdr is fast-locked.
|
||||
// Check that hdr is lightweight-locked.
|
||||
Label hdr_ok;
|
||||
z_lgr(tmp, hdr);
|
||||
z_nill(tmp, markWord::lock_mask_in_place);
|
||||
z_bre(hdr_ok);
|
||||
stop("Header is not fast-locked");
|
||||
stop("Header is not lightweight-locked");
|
||||
bind(hdr_ok);
|
||||
}
|
||||
{
|
||||
|
||||
@ -722,8 +722,8 @@ class MacroAssembler: public Assembler {
|
||||
|
||||
void compiler_fast_lock_object(Register oop, Register box, Register temp1, Register temp2);
|
||||
void compiler_fast_unlock_object(Register oop, Register box, Register temp1, Register temp2);
|
||||
void fast_lock(Register obj, Register hdr, Register tmp, Label& slow);
|
||||
void fast_unlock(Register obj, Register hdr, Register tmp, Label& slow);
|
||||
void lightweight_lock(Register obj, Register hdr, Register tmp, Label& slow);
|
||||
void lightweight_unlock(Register obj, Register hdr, Register tmp, Label& slow);
|
||||
|
||||
void resolve_jobject(Register value, Register tmp1, Register tmp2);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user