RFR: 8300255: Introduce interface for GC oop verification in the assembler [v2]

Fei Yang fyang at openjdk.org
Wed Feb 8 09:05:43 UTC 2023


On Tue, 7 Feb 2023 15:08:34 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> Hi, seems we need two extra small changes to build on linux-riscv. Thanks.
>
>> Hi, seems we need two extra small changes to build on linux-riscv. Thanks.
> 
> Thanks for having a look! Hopefully fixed in the latest commit.

@fisk : Hi, I think we should also add following changes for riscv to make it work:

diff --git a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
index ed53fbf22c8..662de44de29 100644
--- a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp
@@ -316,8 +316,7 @@ void BarrierSetAssembler::check_oop(MacroAssembler* masm, Register obj, Register
   __ mv(tmp2, (intptr_t) Universe::verify_oop_bits());

   // Compare tmp1 and tmp2.
-  __ xorr(tmp1, tmp1, tmp2);
-  __ bnez(tmp1, error);
+  __ bne(tmp1, tmp2, error);

   // Make sure klass is 'reasonable', which is not zero.
   __ load_klass(obj, obj, tmp1); // get klass
diff --git a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp
index 0741869ddaf..1ebfb8f9e23 100644
--- a/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp
@@ -449,10 +449,10 @@ void ZBarrierSetAssembler::generate_c1_load_barrier_runtime_stub(StubAssembler*

 void ZBarrierSetAssembler::check_oop(MacroAssembler* masm, Register obj, Register tmp1, Register tmp2, Label& error) {
   // Check if mask is good.
-  // verifies that ZAddressBadMask & x10 == 0
-  __ ld(c_rarg3, Address(xthread, ZThreadLocalData::address_bad_mask_offset()));
-  __ andr(c_rarg2, x10, c_rarg3);
-  __ bnez(c_rarg2, error);
+  // verifies that ZAddressBadMask & obj == 0
+  __ ld(tmp2, Address(xthread, ZThreadLocalData::address_bad_mask_offset()));
+  __ andr(tmp1, obj, tmp2);
+  __ bnez(tmp1, error);

   BarrierSetAssembler::check_oop(masm, obj, tmp1, tmp2, error);
 }

-------------

PR: https://git.openjdk.org/jdk/pull/12443


More information about the hotspot-dev mailing list