1.1 --- a/src/share/vm/opto/macro.cpp Wed Apr 23 06:35:28 2008 -0400 1.2 +++ b/src/share/vm/opto/macro.cpp Mon Apr 28 08:08:12 2008 -0700 1.3 @@ -584,7 +584,7 @@ 1.4 1.5 const Type *field_type; 1.6 // The next code is taken from Parse::do_get_xxx(). 1.7 - if (basic_elem_type == T_OBJECT) { 1.8 + if (basic_elem_type == T_OBJECT || basic_elem_type == T_ARRAY) { 1.9 if (!elem_type->is_loaded()) { 1.10 field_type = TypeInstPtr::BOTTOM; 1.11 } else if (field != NULL && field->is_constant()) { 1.12 @@ -597,6 +597,10 @@ 1.13 } else { 1.14 field_type = TypeOopPtr::make_from_klass(elem_type->as_klass()); 1.15 } 1.16 + if (UseCompressedOops) { 1.17 + field_type = field_type->is_oopptr()->make_narrowoop(); 1.18 + basic_elem_type = T_NARROWOOP; 1.19 + } 1.20 } else { 1.21 field_type = Type::get_const_basic_type(basic_elem_type); 1.22 } 1.23 @@ -659,6 +663,13 @@ 1.24 #endif 1.25 return false; 1.26 } 1.27 + if (UseCompressedOops && field_type->isa_narrowoop()) { 1.28 + // Enable "DecodeN(EncodeP(Allocate)) --> Allocate" transformation 1.29 + // to be able scalar replace the allocation. 1.30 + _igvn.set_delay_transform(false); 1.31 + field_val = DecodeNNode::decode(&_igvn, field_val); 1.32 + _igvn.set_delay_transform(true); 1.33 + } 1.34 sfpt->add_req(field_val); 1.35 } 1.36 JVMState *jvms = sfpt->jvms();