8387078: RISC-V: x27 can be allocated in CompressedOops mode

Reviewed-by: dzhang, fyang
This commit is contained in:
zifeihan 2026-07-03 06:37:54 +00:00 committed by Dingli Zhang
parent 23d1e859c0
commit 298965828c

View File

@ -1105,8 +1105,9 @@ void reg_mask_init() {
_NO_SPECIAL_PTR_REG_mask.assignFrom(_ALL_REG_mask);
_NO_SPECIAL_PTR_REG_mask.subtract(_NON_ALLOCATABLE_REG_mask);
// x27 is not allocatable when compressed oops is on
if (UseCompressedOops) {
// x27 is not allocatable when compressed oops is on and heapbase is not zero,
// compressed klass pointers doesn't use x27 when heapbase is zero.
if (UseCompressedOops && (CompressedOops::base() != nullptr)) {
_NO_SPECIAL_REG32_mask.remove(OptoReg::as_OptoReg(x27->as_VMReg()));
_NO_SPECIAL_REG_mask.remove(OptoReg::as_OptoReg(x27->as_VMReg()));
_NO_SPECIAL_PTR_REG_mask.remove(OptoReg::as_OptoReg(x27->as_VMReg()));