src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
Print this page
rev 3688 : 7054512: Compress class pointers after perm gen removal
Summary: support of compress class pointers in the compilers.
Reviewed-by:
*** 103,112 ****
--- 103,117 ----
if (UseCompressedOops) {
if (dst->is_address() && !dst->is_stack() && (dst->type() == T_OBJECT || dst->type() == T_ARRAY)) return false;
if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
}
+ if (UseCompressedKlassPointers) {
+ if (src->is_address() && !src->is_stack() && src->type() == T_ADDRESS &&
+ src->as_address_ptr()->disp() == oopDesc::klass_offset_in_bytes()) return false;
+ }
+
if (dst->is_register()) {
if (src->is_address() && Assembler::is_simm13(src->as_address_ptr()->disp())) {
return !PatchALot;
} else if (src->is_single_stack()) {
return true;
*** 967,978 ****
__ ld(base, offset + hi_word_offset_in_bytes, to_reg->as_register_hi());
}
#endif
}
break;
! case T_METADATA:
! case T_ADDRESS: __ ld_ptr(base, offset, to_reg->as_register()); break;
case T_ARRAY : // fall through
case T_OBJECT:
{
if (UseCompressedOops && !wide) {
__ lduw(base, offset, to_reg->as_register());
--- 972,990 ----
__ ld(base, offset + hi_word_offset_in_bytes, to_reg->as_register_hi());
}
#endif
}
break;
! case T_METADATA: __ ld_ptr(base, offset, to_reg->as_register()); break;
! case T_ADDRESS:
! if (UseCompressedKlassPointers && offset == oopDesc::klass_offset_in_bytes()) {
! __ lduw(base, offset, to_reg->as_register());
! __ decode_klass_not_null(to_reg->as_register());
! } else {
! __ ld_ptr(base, offset, to_reg->as_register());
! }
! break;
case T_ARRAY : // fall through
case T_OBJECT:
{
if (UseCompressedOops && !wide) {
__ lduw(base, offset, to_reg->as_register());
*** 2342,2352 ****
Label known_ok, halt;
metadata2reg(op->expected_type()->constant_encoding(), tmp);
if (UseCompressedKlassPointers) {
// tmp holds the default type. It currently comes uncompressed after the
// load of a constant, so encode it.
! __ encode_heap_oop(tmp);
// load the raw value of the dst klass, since we will be comparing
// uncompressed values directly.
__ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
if (basic_type != T_OBJECT) {
__ cmp(tmp, tmp2);
--- 2354,2364 ----
Label known_ok, halt;
metadata2reg(op->expected_type()->constant_encoding(), tmp);
if (UseCompressedKlassPointers) {
// tmp holds the default type. It currently comes uncompressed after the
// load of a constant, so encode it.
! __ encode_klass_not_null(tmp);
// load the raw value of the dst klass, since we will be comparing
// uncompressed values directly.
__ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
if (basic_type != T_OBJECT) {
__ cmp(tmp, tmp2);