8291555: Implement alternative fast-locking scheme

Co-authored-by: Fei Yang <fyang@openjdk.org>
Co-authored-by: Thomas Stuefe <stuefe@openjdk.org>
Reviewed-by: dcubed, stuefe, shade, dholmes, dlong
This commit is contained in:
Roman Kennke 2023-05-08 17:51:39 +00:00
parent 4116b109f0
commit 7f6358a8b5
70 changed files with 2444 additions and 767 deletions

View file

@ -119,7 +119,7 @@ bool oopDesc::is_oop(oop obj, bool ignore_mark_word) {
}
// Header verification: the mark is typically non-zero. If we're
// at a safepoint, it must not be zero.
// at a safepoint, it must not be zero, except when using the new lightweight locking.
// Outside of a safepoint, the header could be changing (for example,
// another thread could be inflating a lock on this object).
if (ignore_mark_word) {
@ -128,7 +128,7 @@ bool oopDesc::is_oop(oop obj, bool ignore_mark_word) {
if (obj->mark().value() != 0) {
return true;
}
return !SafepointSynchronize::is_at_safepoint();
return LockingMode == LM_LIGHTWEIGHT || !SafepointSynchronize::is_at_safepoint();
}
// used only for asserts and guarantees