Skip to content

Commit 2f4098e

Browse files
zhengxiaolinXRealFYang
authored andcommitted
8299168: RISC-V: Fix MachNode size mismatch for MacroAssembler::_verify_oops*
Reviewed-by: fyang
1 parent 2294f22 commit 2f4098e

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,13 @@ void MacroAssembler::_verify_oop(Register reg, const char* s, const char* file,
408408
push_reg(RegSet::of(ra, t0, t1, c_rarg0), sp);
409409

410410
mv(c_rarg0, reg); // c_rarg0 : x10
411-
// The length of the instruction sequence emitted should be independent
412-
// of the value of the local char buffer address so that the size of mach
413-
// nodes for scratch emit and normal emit matches.
414-
movptr(t0, (address)b);
411+
{
412+
// The length of the instruction sequence emitted should not depend
413+
// on the address of the char buffer so that the size of mach nodes for
414+
// scratch emit and normal emit matches.
415+
IncompressibleRegion ir(this); // Fixed length
416+
movptr(t0, (address) b);
417+
}
415418

416419
// call indirectly to solve generation ordering problem
417420
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
450453
ld(x10, addr);
451454
}
452455

453-
// The length of the instruction sequence emitted should be independent
454-
// of the value of the local char buffer address so that the size of mach
455-
// nodes for scratch emit and normal emit matches.
456-
movptr(t0, (address)b);
456+
{
457+
// The length of the instruction sequence emitted should not depend
458+
// on the address of the char buffer so that the size of mach nodes for
459+
// scratch emit and normal emit matches.
460+
IncompressibleRegion ir(this); // Fixed length
461+
movptr(t0, (address) b);
462+
}
457463

458464
// call indirectly to solve generation ordering problem
459465
ExternalAddress target(StubRoutines::verify_oop_subroutine_entry_address());

0 commit comments

Comments
 (0)