8298075: RISC-V: Implement post-call NOPs

Reviewed-by: fyang, luhenry
This commit is contained in:
Xiaolin Zheng 2022-12-08 02:19:35 +00:00 committed by Fei Yang
parent 3aa4070d4c
commit 74f346b33f
6 changed files with 37 additions and 7 deletions

View file

@ -444,8 +444,16 @@ void NativePostCallNop::make_deopt() {
NativeDeoptInstruction::insert(addr_at(0));
}
int NativePostCallNop::displacement() const {
// Discard the high 32 bits
return (int)(intptr_t)MacroAssembler::get_target_of_li32(addr_at(4));
}
void NativePostCallNop::patch(jint diff) {
// unsupported for now
assert(diff != 0, "must be");
assert(is_lui_to_zr_at(addr_at(4)) && is_addiw_to_zr_at(addr_at(8)), "must be");
MacroAssembler::patch_imm_in_li32(addr_at(4), diff);
}
void NativeDeoptInstruction::verify() {