8294087: RISC-V: RVC: Fix a potential alignment issue and add more alignment assertions for the patchable calls/nops

Reviewed-by: shade, fjiang, fyang
This commit is contained in:
Xiaolin Zheng 2022-09-22 11:43:47 +00:00 committed by Fei Yang
parent 3fa6778ab2
commit a216960d71
9 changed files with 30 additions and 5 deletions

View file

@ -30,6 +30,7 @@
#include "asm/assembler.hpp"
#include "code/vmreg.hpp"
#include "metaprogramming/enableIf.hpp"
#include "nativeInst_riscv.hpp"
#include "oops/compressedOops.hpp"
#include "utilities/powerOfTwo.hpp"
@ -49,6 +50,9 @@ class MacroAssembler: public Assembler {
// Alignment
int align(int modulus, int extra_offset = 0);
static inline void assert_alignment(address pc, int alignment = NativeInstruction::instruction_size) {
assert(is_aligned(pc, alignment), "bad alignment");
}
// Stack frame creation/removal
// Note that SP must be updated to the right place before saving/restoring RA and FP