After compressed opcodes were enabled by default, we may have a 4-byte opcode located at 2-byte aligned address, but not 4-byte aligned address ( e.g. ending with 2/6/a/e in hex form)
This code then may produce misaligned read, and on some hardware (e.g. hifive) may result in misaligned load emulation thru m-mode
static bool is_deopt_at(address instr) {
assert(instr != nullptr, "");
uint32_t value = *(uint32_t *) instr;
// 0xc0201073 encodes CSRRW x0, instret, x0
return value == 0xc0201073;
}
direct pointer dereference should be replaced with a proper method
This code then may produce misaligned read, and on some hardware (e.g. hifive) may result in misaligned load emulation thru m-mode
static bool is_deopt_at(address instr) {
assert(instr != nullptr, "");
uint32_t value = *(uint32_t *) instr;
// 0xc0201073 encodes CSRRW x0, instret, x0
return value == 0xc0201073;
}
direct pointer dereference should be replaced with a proper method
- relates to
-
JDK-8291550 RISC-V: jdk uses misaligned memory access when AvoidUnalignedAccess enabled
-
- Resolved
-