< prev index next >

src/share/vm/opto/type.cpp

Print this page




2815     } else if (klass() == NULL) {
2816       // Array with unknown body type
2817       assert(this->isa_aryptr(), "only arrays without klass");
2818       _is_ptr_to_narrowoop = UseCompressedOops;
2819     } else if (this->isa_aryptr()) {
2820       _is_ptr_to_narrowoop = (UseCompressedOops && klass()->is_obj_array_klass() &&
2821                              _offset != arrayOopDesc::length_offset_in_bytes());
2822     } else if (klass()->is_instance_klass()) {
2823       ciInstanceKlass* ik = klass()->as_instance_klass();
2824       ciField* field = NULL;
2825       if (this->isa_klassptr()) {
2826         // Perm objects don't use compressed references
2827       } else if (_offset == OffsetBot || _offset == OffsetTop) {
2828         // unsafe access
2829         _is_ptr_to_narrowoop = UseCompressedOops;
2830       } else { // exclude unsafe ops
2831         assert(this->isa_instptr(), "must be an instance ptr.");
2832 
2833         if (klass() == ciEnv::current()->Class_klass() &&
2834             (_offset == java_lang_Class::klass_offset_in_bytes() ||
2835              _offset == java_lang_Class::array_klass_offset_in_bytes())) {
2836           // Special hidden fields from the Class.
2837           assert(this->isa_instptr(), "must be an instance ptr.");
2838           _is_ptr_to_narrowoop = false;
2839         } else if (klass() == ciEnv::current()->Class_klass() &&
2840                    _offset >= InstanceMirrorKlass::offset_of_static_fields()) {
2841           // Static fields
2842           assert(o != NULL, "must be constant");
2843           ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
2844           ciField* field = k->get_field_by_offset(_offset, true);
2845           assert(field != NULL, "missing field");
2846           BasicType basic_elem_type = field->layout_type();
2847           _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
2848                                                        basic_elem_type == T_ARRAY);
2849         } else {
2850           // Instance fields which contains a compressed oop references.
2851           field = ik->get_field_by_offset(_offset, false);
2852           if (field != NULL) {
2853             BasicType basic_elem_type = field->layout_type();
2854             _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
2855                                                          basic_elem_type == T_ARRAY);




2815     } else if (klass() == NULL) {
2816       // Array with unknown body type
2817       assert(this->isa_aryptr(), "only arrays without klass");
2818       _is_ptr_to_narrowoop = UseCompressedOops;
2819     } else if (this->isa_aryptr()) {
2820       _is_ptr_to_narrowoop = (UseCompressedOops && klass()->is_obj_array_klass() &&
2821                              _offset != arrayOopDesc::length_offset_in_bytes());
2822     } else if (klass()->is_instance_klass()) {
2823       ciInstanceKlass* ik = klass()->as_instance_klass();
2824       ciField* field = NULL;
2825       if (this->isa_klassptr()) {
2826         // Perm objects don't use compressed references
2827       } else if (_offset == OffsetBot || _offset == OffsetTop) {
2828         // unsafe access
2829         _is_ptr_to_narrowoop = UseCompressedOops;
2830       } else { // exclude unsafe ops
2831         assert(this->isa_instptr(), "must be an instance ptr.");
2832 
2833         if (klass() == ciEnv::current()->Class_klass() &&
2834             (_offset == java_lang_Class::klass_offset_in_bytes() ||
2835              _offset == java_lang_Class::array_klass_offset_in_bytes()) || UseShenandoahGC) {
2836           // Special hidden fields from the Class.
2837           assert(this->isa_instptr(), "must be an instance ptr.");
2838           _is_ptr_to_narrowoop = false;
2839         } else if (klass() == ciEnv::current()->Class_klass() &&
2840                    _offset >= InstanceMirrorKlass::offset_of_static_fields()) {
2841           // Static fields
2842           assert(o != NULL, "must be constant");
2843           ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
2844           ciField* field = k->get_field_by_offset(_offset, true);
2845           assert(field != NULL, "missing field");
2846           BasicType basic_elem_type = field->layout_type();
2847           _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
2848                                                        basic_elem_type == T_ARRAY);
2849         } else {
2850           // Instance fields which contains a compressed oop references.
2851           field = ik->get_field_by_offset(_offset, false);
2852           if (field != NULL) {
2853             BasicType basic_elem_type = field->layout_type();
2854             _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
2855                                                          basic_elem_type == T_ARRAY);


< prev index next >