2979 _is_ptr_to_narrowoop = (UseCompressedOops && klass()->is_obj_array_klass() &&
2980 _offset != arrayOopDesc::length_offset_in_bytes());
2981 } else if (klass()->is_instance_klass()) {
2982 ciInstanceKlass* ik = klass()->as_instance_klass();
2983 ciField* field = NULL;
2984 if (this->isa_klassptr()) {
2985 // Perm objects don't use compressed references
2986 } else if (_offset == OffsetBot || _offset == OffsetTop) {
2987 // unsafe access
2988 _is_ptr_to_narrowoop = UseCompressedOops;
2989 } else { // exclude unsafe ops
2990 assert(this->isa_instptr(), "must be an instance ptr.");
2991
2992 if (klass() == ciEnv::current()->Class_klass() &&
2993 (_offset == java_lang_Class::klass_offset_in_bytes() ||
2994 _offset == java_lang_Class::array_klass_offset_in_bytes())) {
2995 // Special hidden fields from the Class.
2996 assert(this->isa_instptr(), "must be an instance ptr.");
2997 _is_ptr_to_narrowoop = false;
2998 } else if (klass() == ciEnv::current()->Class_klass() &&
2999 _offset >= InstanceMirrorKlass::offset_of_static_fields() &&
3000 !UseShenandoahGC) {
3001 // Static fields
3002 assert(o != NULL, "must be constant");
3003 ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
3004 ciField* field = k->get_field_by_offset(_offset, true);
3005 assert(field != NULL, "missing field");
3006 BasicType basic_elem_type = field->layout_type();
3007 _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
3008 basic_elem_type == T_ARRAY);
3009 } else {
3010 // Instance fields which contains a compressed oop references.
3011 field = ik->get_field_by_offset(_offset, false);
3012 if (field != NULL) {
3013 BasicType basic_elem_type = field->layout_type();
3014 _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
3015 basic_elem_type == T_ARRAY);
3016 } else if (klass()->equals(ciEnv::current()->Object_klass())) {
3017 // Compile::find_alias_type() cast exactness on all types to verify
3018 // that it does not affect alias type.
3019 _is_ptr_to_narrowoop = UseCompressedOops;
3020 } else {
|
2979 _is_ptr_to_narrowoop = (UseCompressedOops && klass()->is_obj_array_klass() &&
2980 _offset != arrayOopDesc::length_offset_in_bytes());
2981 } else if (klass()->is_instance_klass()) {
2982 ciInstanceKlass* ik = klass()->as_instance_klass();
2983 ciField* field = NULL;
2984 if (this->isa_klassptr()) {
2985 // Perm objects don't use compressed references
2986 } else if (_offset == OffsetBot || _offset == OffsetTop) {
2987 // unsafe access
2988 _is_ptr_to_narrowoop = UseCompressedOops;
2989 } else { // exclude unsafe ops
2990 assert(this->isa_instptr(), "must be an instance ptr.");
2991
2992 if (klass() == ciEnv::current()->Class_klass() &&
2993 (_offset == java_lang_Class::klass_offset_in_bytes() ||
2994 _offset == java_lang_Class::array_klass_offset_in_bytes())) {
2995 // Special hidden fields from the Class.
2996 assert(this->isa_instptr(), "must be an instance ptr.");
2997 _is_ptr_to_narrowoop = false;
2998 } else if (klass() == ciEnv::current()->Class_klass() &&
2999 _offset >= InstanceMirrorKlass::offset_of_static_fields()) {
3000 // Static fields
3001 assert(o != NULL, "must be constant");
3002 ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
3003 ciField* field = k->get_field_by_offset(_offset, true);
3004 assert(field != NULL, "missing field");
3005 BasicType basic_elem_type = field->layout_type();
3006 _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
3007 basic_elem_type == T_ARRAY);
3008 } else {
3009 // Instance fields which contains a compressed oop references.
3010 field = ik->get_field_by_offset(_offset, false);
3011 if (field != NULL) {
3012 BasicType basic_elem_type = field->layout_type();
3013 _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
3014 basic_elem_type == T_ARRAY);
3015 } else if (klass()->equals(ciEnv::current()->Object_klass())) {
3016 // Compile::find_alias_type() cast exactness on all types to verify
3017 // that it does not affect alias type.
3018 _is_ptr_to_narrowoop = UseCompressedOops;
3019 } else {
|