8296630: Fix SkipIfEqual on AArch64 and RISC-V

Reviewed-by: ngasson, fyang, luhenry, aph
This commit is contained in:
Yadong Wang 2022-11-13 03:07:09 +00:00 committed by Fei Yang
parent 657a0b2f15
commit a2cdcdd65d
2 changed files with 10 additions and 2 deletions

View File

@ -3976,7 +3976,11 @@ SkipIfEqual::SkipIfEqual(
uint64_t offset;
_masm->adrp(rscratch1, ExternalAddress((address)flag_addr), offset);
_masm->ldrb(rscratch1, Address(rscratch1, offset));
_masm->cbzw(rscratch1, _label);
if (value) {
_masm->cbnzw(rscratch1, _label);
} else {
_masm->cbzw(rscratch1, _label);
}
}
SkipIfEqual::~SkipIfEqual() {

View File

@ -2061,7 +2061,11 @@ SkipIfEqual::SkipIfEqual(MacroAssembler* masm, const bool* flag_addr, bool value
_masm->la_patchable(t0, target, offset);
_masm->lbu(t0, Address(t0, offset));
});
_masm->beqz(t0, _label);
if (value) {
_masm->bnez(t0, _label);
} else {
_masm->beqz(t0, _label);
}
}
SkipIfEqual::~SkipIfEqual() {