< prev index next >

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Print this page
@@ -2532,12 +2532,11 @@
  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;
    }

@@ -2549,13 +2548,12 @@
  
    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);
    }
  }
  

@@ -2567,12 +2565,11 @@
  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;
    }

@@ -2590,12 +2587,11 @@
  
    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 >