From 2f4098e1dc9c97e706d70008e473f9c4496cbc8a Mon Sep 17 00:00:00 2001 From: Xiaolin Zheng Date: Fri, 23 Dec 2022 09:22:39 +0000 Subject: [PATCH] 8299168: RISC-V: Fix MachNode size mismatch for MacroAssembler::_verify_oops* Reviewed-by: fyang --- .../cpu/riscv/macroAssembler_riscv.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index ec45262c8f3..ebdb5f04dce 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -408,10 +408,13 @@ void MacroAssembler::_verify_oop(Register reg, const char* s, const char* file, push_reg(RegSet::of(ra, t0, t1, c_rarg0), sp); mv(c_rarg0, reg); // c_rarg0 : x10 - // The length of the instruction sequence emitted should be independent - // of the value of the local char buffer address so that the size of mach - // nodes for scratch emit and normal emit matches. - movptr(t0, (address)b); + { + // The length of the instruction sequence emitted should not depend + // on the address of the char buffer so that the size of mach nodes for + // scratch emit and normal emit matches. + IncompressibleRegion ir(this); // Fixed length + movptr(t0, (address) b); + } // call indirectly to solve generation ordering problem ExternalAddress target(StubRoutines::verify_oop_subroutine_entry_address()); @@ -450,10 +453,13 @@ void MacroAssembler::_verify_oop_addr(Address addr, const char* s, const char* f ld(x10, addr); } - // The length of the instruction sequence emitted should be independent - // of the value of the local char buffer address so that the size of mach - // nodes for scratch emit and normal emit matches. - movptr(t0, (address)b); + { + // The length of the instruction sequence emitted should not depend + // on the address of the char buffer so that the size of mach nodes for + // scratch emit and normal emit matches. + IncompressibleRegion ir(this); // Fixed length + movptr(t0, (address) b); + } // call indirectly to solve generation ordering problem ExternalAddress target(StubRoutines::verify_oop_subroutine_entry_address());