< prev index next >

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

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

@@ -2326,13 +2325,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);
    }
  }
  

@@ -2344,12 +2342,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;
    }

@@ -2367,12 +2364,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 >