src/cpu/x86/vm/assembler_x86.cpp

changeset 1934
e9ff18c4ace7
parent 1907
c18cbe5936b8
parent 1926
2d127394260e
child 1938
02e771df338e
     1.1 --- a/src/cpu/x86/vm/assembler_x86.cpp	Tue Jun 01 11:48:33 2010 -0700
     1.2 +++ b/src/cpu/x86/vm/assembler_x86.cpp	Wed Jun 02 22:45:42 2010 -0700
     1.3 @@ -8185,9 +8185,14 @@
     1.4      assert (Universe::heap() != NULL, "java heap should be initialized");
     1.5      movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
     1.6      if (Universe::narrow_oop_shift() != 0) {
     1.7 -      assert(Address::times_8 == LogMinObjAlignmentInBytes &&
     1.8 -             Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong");
     1.9 -      movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
    1.10 +      assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
    1.11 +      if (LogMinObjAlignmentInBytes == Address::times_8) {
    1.12 +        movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
    1.13 +      } else {
    1.14 +        // OK to use shift since we don't need to preserve flags.
    1.15 +        shlq(dst, LogMinObjAlignmentInBytes);
    1.16 +        movq(dst, Address(r12_heapbase, dst, Address::times_1, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
    1.17 +      }
    1.18      } else {
    1.19        movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
    1.20      }
    1.21 @@ -8361,31 +8366,43 @@
    1.22  }
    1.23  
    1.24  void  MacroAssembler::decode_heap_oop_not_null(Register r) {
    1.25 +  // Note: it will change flags
    1.26    assert (UseCompressedOops, "should only be used for compressed headers");
    1.27    assert (Universe::heap() != NULL, "java heap should be initialized");
    1.28    // Cannot assert, unverified entry point counts instructions (see .ad file)
    1.29    // vtableStubs also counts instructions in pd_code_size_limit.
    1.30    // Also do not verify_oop as this is called by verify_oop.
    1.31    if (Universe::narrow_oop_shift() != 0) {
    1.32 -    assert (Address::times_8 == LogMinObjAlignmentInBytes &&
    1.33 -            Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong");
    1.34 -    // Don't use Shift since it modifies flags.
    1.35 -    leaq(r, Address(r12_heapbase, r, Address::times_8, 0));
    1.36 +    assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
    1.37 +    shlq(r, LogMinObjAlignmentInBytes);
    1.38 +    if (Universe::narrow_oop_base() != NULL) {
    1.39 +      addq(r, r12_heapbase);
    1.40 +    }
    1.41    } else {
    1.42      assert (Universe::narrow_oop_base() == NULL, "sanity");
    1.43    }
    1.44  }
    1.45  
    1.46  void  MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) {
    1.47 +  // Note: it will change flags
    1.48    assert (UseCompressedOops, "should only be used for compressed headers");
    1.49    assert (Universe::heap() != NULL, "java heap should be initialized");
    1.50    // Cannot assert, unverified entry point counts instructions (see .ad file)
    1.51    // vtableStubs also counts instructions in pd_code_size_limit.
    1.52    // Also do not verify_oop as this is called by verify_oop.
    1.53    if (Universe::narrow_oop_shift() != 0) {
    1.54 -    assert (Address::times_8 == LogMinObjAlignmentInBytes &&
    1.55 -            Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong");
    1.56 -    leaq(dst, Address(r12_heapbase, src, Address::times_8, 0));
    1.57 +    assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
    1.58 +    if (LogMinObjAlignmentInBytes == Address::times_8) {
    1.59 +      leaq(dst, Address(r12_heapbase, src, Address::times_8, 0));
    1.60 +    } else {
    1.61 +      if (dst != src) {
    1.62 +        movq(dst, src);
    1.63 +      }
    1.64 +      shlq(dst, LogMinObjAlignmentInBytes);
    1.65 +      if (Universe::narrow_oop_base() != NULL) {
    1.66 +        addq(dst, r12_heapbase);
    1.67 +      }
    1.68 +    }
    1.69    } else if (dst != src) {
    1.70      assert (Universe::narrow_oop_base() == NULL, "sanity");
    1.71      movq(dst, src);

mercurial