src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp

changeset 4164
d804e148cff8
parent 4142
d8ce2825b193
parent 4162
94e9408dbf50
child 4860
46f6f063b272
     1.1 --- a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp	Tue Oct 09 10:09:34 2012 -0700
     1.2 +++ b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp	Fri Oct 12 09:22:52 2012 -0700
     1.3 @@ -105,6 +105,11 @@
     1.4          if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
     1.5        }
     1.6  
     1.7 +      if (UseCompressedKlassPointers) {
     1.8 +        if (src->is_address() && !src->is_stack() && src->type() == T_ADDRESS &&
     1.9 +            src->as_address_ptr()->disp() == oopDesc::klass_offset_in_bytes()) return false;
    1.10 +      }
    1.11 +
    1.12        if (dst->is_register()) {
    1.13          if (src->is_address() && Assembler::is_simm13(src->as_address_ptr()->disp())) {
    1.14            return !PatchALot;
    1.15 @@ -969,8 +974,18 @@
    1.16  #endif
    1.17          }
    1.18          break;
    1.19 -      case T_METADATA:
    1.20 -      case T_ADDRESS:  __ ld_ptr(base, offset, to_reg->as_register()); break;
    1.21 +      case T_METADATA:  __ ld_ptr(base, offset, to_reg->as_register()); break;
    1.22 +      case T_ADDRESS:
    1.23 +#ifdef _LP64
    1.24 +        if (offset == oopDesc::klass_offset_in_bytes() && UseCompressedKlassPointers) {
    1.25 +          __ lduw(base, offset, to_reg->as_register());
    1.26 +          __ decode_klass_not_null(to_reg->as_register());
    1.27 +        } else
    1.28 +#endif
    1.29 +        {
    1.30 +          __ ld_ptr(base, offset, to_reg->as_register());
    1.31 +        }
    1.32 +        break;
    1.33        case T_ARRAY : // fall through
    1.34        case T_OBJECT:
    1.35          {
    1.36 @@ -2344,7 +2359,7 @@
    1.37      if (UseCompressedKlassPointers) {
    1.38        // tmp holds the default type. It currently comes uncompressed after the
    1.39        // load of a constant, so encode it.
    1.40 -      __ encode_heap_oop(tmp);
    1.41 +      __ encode_klass_not_null(tmp);
    1.42        // load the raw value of the dst klass, since we will be comparing
    1.43        // uncompressed values directly.
    1.44        __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);

mercurial