dragonwell-project / dragonwell21

GNU General Public License v2.0
70 stars 20 forks source link

[Backport] Recursive lightweight locking #120

Closed linade closed 3 weeks ago

linade commented 3 weeks ago

Backport the following patches to address a [regression](https://aliyuque.antfin.com/yude.lyd/oz0e1u/zzxn78rdkxolwrap?singleDoc# 《Deflate regression》) in compact object headers :

8329091: [Lilliput/JDK21] Fix tests after LM_LIGHTWEIGHT backports 8329757: Crash with fatal error: DEBUG MESSAGE: Fast Unlock lock on stack 8319900: Recursive lightweight locking: riscv64 implementation 8319801: Recursive lightweight locking: aarch64 implementation 8319799: Recursive lightweight locking: x86 implementation 8319797: Recursive lightweight locking: Runtime implementation

patches apply cleanly except for cpu/x86/c2_CodeStubs_x86.cpp conflict caused by 8319799

CLAassistant commented 3 weeks ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 3 committers have signed the CLA.

:x: zifeihan
:x: xmas92
:x: rkennke
You have signed the CLA already but the status is still pending? Let us recheck it.

linade commented 3 weeks ago

The conflict in cpu/x86/c2_CodeStubs_x86.cpp is caused by this patch. It's not hard to resolve, since C2LoadNKlassStub is not relevant to the current PR.

$git show 64dff318febb -- src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp 
commit 64dff318febb7cf639d95e039591e4e89e4db0de
Author: Yude Lin <yude.lyd@alibaba-inc.com>
Date:   Thu Jul 18 14:53:13 2024 +0800

    [Backport] 8316126: [Lilliput/JDK21] Cherry-pick: 8305895: Implementation: JEP 450: Compact Object Headers

    Summary: Backport
    8316126: [Lilliput/JDK21] Cherry-pick: 8305895: Implementation: JEP 450: Compact Object Headers (Experimental)
    8317954: [Lilliput/JDK21] Make C2 LoadNKlassCompactHeader more robust
    8316687: [Lilliput/JDK21] Various cleanups
    8319724: [Lilliput] ParallelGC: Forwarded objects found during heap inspection
    8316424: [Lilliput/JDK21] ZGC/CDS-related test fixes
    And make UseCompactObjectHeaders product

    Testing: CICD (all jtreg)

    Reviewers: mmyxym, lingjun-cg, kuaiwei

    Issue: https://github.com/dragonwell-project/dragonwell21/issues/75

diff --git a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
index cd5e87b29ec..a2f60bd2321 100644
--- a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
+++ b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp
@@ -93,6 +93,18 @@ void C2HandleAnonOMOwnerStub::emit(C2_MacroAssembler& masm) {
 #endif
   __ jmp(continuation());
 }
+
+int C2LoadNKlassStub::max_size() const {
+  return 10;
+}
+
+void C2LoadNKlassStub::emit(C2_MacroAssembler& masm) {
+  __ bind(entry());
+  Register d = dst();
+  __ movq(d, Address(d, OM_OFFSET_NO_MONITOR_VALUE_TAG(header)));
+  __ jmp(continuation());
+}
+
 #endif

 #undef __