Fix a bug when decoding the compressed klass oops.

Mon, 12 Sep 2016 13:59:25 -0400

author
fujie
date
Mon, 12 Sep 2016 13:59:25 -0400
changeset 105
b863b5fdce61
parent 104
36f7453a6977
child 106
ebe1a38c3e4f

Fix a bug when decoding the compressed klass oops.

src/cpu/mips/vm/assembler_mips.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/mips/vm/assembler_mips.cpp	Mon Sep 12 13:50:08 2016 -0400
     1.2 +++ b/src/cpu/mips/vm/assembler_mips.cpp	Mon Sep 12 13:59:25 2016 -0400
     1.3 @@ -4064,7 +4064,7 @@
     1.4      assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
     1.5      shl(r, LogMinObjAlignmentInBytes);
     1.6      if (Universe::narrow_oop_base() != NULL) {
     1.7 -      dadd(r, r, S5_heapbase);
     1.8 +      daddu(r, r, S5_heapbase);
     1.9      }
    1.10    } else {
    1.11      assert (Universe::narrow_oop_base() == NULL, "sanity");
    1.12 @@ -4083,14 +4083,14 @@
    1.13      assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
    1.14      if (LogMinObjAlignmentInBytes == Address::times_8) {
    1.15        dsll(dst, src, LogMinObjAlignmentInBytes);
    1.16 -      dadd(dst, dst, S5_heapbase);
    1.17 +      daddu(dst, dst, S5_heapbase);
    1.18      } else {
    1.19        if (dst != src) {
    1.20          move(dst, src);
    1.21        }
    1.22        shl(dst, LogMinObjAlignmentInBytes);
    1.23        if (Universe::narrow_oop_base() != NULL) {
    1.24 -        dadd(dst, dst, S5_heapbase);
    1.25 +        daddu(dst, dst, S5_heapbase);
    1.26        }
    1.27      }
    1.28    } else {
    1.29 @@ -4104,7 +4104,7 @@
    1.30  void MacroAssembler::encode_klass_not_null(Register r) {
    1.31    if (Universe::narrow_klass_base() != NULL) {
    1.32      // Use r12 as a scratch register in which to temporarily load the narrow_klass_base.
    1.33 -    assert(r != S5_heapbase, "Encoding a klass in r12");
    1.34 +    assert(r != S5_heapbase, "Encoding a klass in S5_heapbase");
    1.35      li48(S5_heapbase, (int64_t)Universe::narrow_klass_base());
    1.36      dsub(r, r, S5_heapbase);
    1.37    }
    1.38 @@ -4152,7 +4152,7 @@
    1.39  void  MacroAssembler::decode_klass_not_null(Register r) { 
    1.40    // Note: it will change flags
    1.41    assert (UseCompressedClassPointers, "should only be used for compressed headers");
    1.42 -  assert(r != S5_heapbase, "Decoding a klass in r12");
    1.43 +  assert(r != S5_heapbase, "Decoding a klass in S5_heapbase");
    1.44    // Cannot assert, unverified entry point counts instructions (see .ad file)
    1.45    // vtableStubs also counts instructions in pd_code_size_limit.
    1.46    // Also do not verify_oop as this is called by verify_oop.
    1.47 @@ -4162,7 +4162,7 @@
    1.48    }
    1.49    if (Universe::narrow_klass_base() != NULL) {
    1.50      li48(S5_heapbase, (int64_t)Universe::narrow_klass_base());
    1.51 -    dadd(r, r, S5_heapbase);
    1.52 +    daddu(r, r, S5_heapbase);
    1.53      reinit_heapbase();
    1.54    }
    1.55  }
    1.56 @@ -4176,16 +4176,15 @@
    1.57      // Cannot assert, unverified entry point counts instructions (see .ad file)
    1.58      // vtableStubs also counts instructions in pd_code_size_limit.
    1.59      // Also do not verify_oop as this is called by verify_oop.
    1.60 -    li48(S5_heapbase, (int64_t)Universe::narrow_klass_base());
    1.61 +    li48(dst, (int64_t)Universe::narrow_klass_base());
    1.62      if (Universe::narrow_klass_shift() != 0) {
    1.63        assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
    1.64        assert(LogKlassAlignmentInBytes == Address::times_8, "klass not aligned on 64bits?");
    1.65 -      dsll(dst, src, Address::times_8);
    1.66 -      dadd(dst, dst, S5_heapbase);
    1.67 +      dsll(AT, src, Address::times_8);
    1.68 +      daddu(dst, dst, AT);
    1.69      } else {
    1.70 -      dadd(dst, src, S5_heapbase);
    1.71 +      daddu(dst, src, dst);
    1.72      }
    1.73 -    reinit_heapbase();
    1.74    }
    1.75  }
    1.76  

mercurial