< prev index next > src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Print this page
void MacroAssembler::decode_klass_not_null(Register dst, Register src, Register tmp) {
assert(UseCompressedClassPointers, "should only be used for compressed headers");
if (CompressedKlassPointers::base() == nullptr) {
if (CompressedKlassPointers::shift() != 0) {
- assert(LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong");
- slli(dst, src, LogKlassAlignmentInBytes);
+ slli(dst, src, CompressedKlassPointers::shift());
} else {
mv(dst, src);
}
return;
}
assert_different_registers(src, xbase);
mv(xbase, (uintptr_t)CompressedKlassPointers::base());
if (CompressedKlassPointers::shift() != 0) {
- assert(LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong");
assert_different_registers(t0, xbase);
- shadd(dst, src, xbase, t0, LogKlassAlignmentInBytes);
+ shadd(dst, src, xbase, t0, CompressedKlassPointers::shift());
} else {
add(dst, xbase, src);
}
}
void MacroAssembler::encode_klass_not_null(Register dst, Register src, Register tmp) {
assert(UseCompressedClassPointers, "should only be used for compressed headers");
if (CompressedKlassPointers::base() == nullptr) {
if (CompressedKlassPointers::shift() != 0) {
- assert(LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong");
- srli(dst, src, LogKlassAlignmentInBytes);
+ srli(dst, src, CompressedKlassPointers::shift());
} else {
mv(dst, src);
}
return;
}
assert_different_registers(src, xbase);
mv(xbase, (uintptr_t)CompressedKlassPointers::base());
sub(dst, src, xbase);
if (CompressedKlassPointers::shift() != 0) {
- assert(LogKlassAlignmentInBytes == CompressedKlassPointers::shift(), "decode alg wrong");
- srli(dst, dst, LogKlassAlignmentInBytes);
+ srli(dst, dst, CompressedKlassPointers::shift());
}
}
void MacroAssembler::decode_heap_oop_not_null(Register r) {
decode_heap_oop_not_null(r, r);
< prev index next >