< prev index next >

src/hotspot/share/opto/type.cpp

Print this page
rev 52415 : 8213371: GC/C2 abstraction and cleanup to handle custom offset for GC memory accesses


2943 
2944 //=============================================================================
2945 // Convenience common pre-built type.
2946 const TypeOopPtr *TypeOopPtr::BOTTOM;
2947 
2948 //------------------------------TypeOopPtr-------------------------------------
2949 TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset,
2950                        int instance_id, const TypePtr* speculative, int inline_depth)
2951   : TypePtr(t, ptr, offset, speculative, inline_depth),
2952     _const_oop(o), _klass(k),
2953     _klass_is_exact(xk),
2954     _is_ptr_to_narrowoop(false),
2955     _is_ptr_to_narrowklass(false),
2956     _is_ptr_to_boxed_value(false),
2957     _instance_id(instance_id) {
2958   if (Compile::current()->eliminate_boxing() && (t == InstPtr) &&
2959       (offset > 0) && xk && (k != 0) && k->is_instance_klass()) {
2960     _is_ptr_to_boxed_value = k->as_instance_klass()->is_boxed_value_offset(offset);
2961   }
2962 #ifdef _LP64
2963   if (_offset != 0) {
2964     if (_offset == oopDesc::klass_offset_in_bytes()) {
2965       _is_ptr_to_narrowklass = UseCompressedClassPointers;
2966     } else if (klass() == NULL) {
2967       // Array with unknown body type
2968       assert(this->isa_aryptr(), "only arrays without klass");
2969       _is_ptr_to_narrowoop = UseCompressedOops;
2970     } else if (this->isa_aryptr()) {
2971       _is_ptr_to_narrowoop = (UseCompressedOops && klass()->is_obj_array_klass() &&
2972                              _offset != arrayOopDesc::length_offset_in_bytes());
2973     } else if (klass()->is_instance_klass()) {
2974       ciInstanceKlass* ik = klass()->as_instance_klass();
2975       ciField* field = NULL;
2976       if (this->isa_klassptr()) {
2977         // Perm objects don't use compressed references
2978       } else if (_offset == OffsetBot || _offset == OffsetTop) {
2979         // unsafe access
2980         _is_ptr_to_narrowoop = UseCompressedOops;
2981       } else { // exclude unsafe ops
2982         assert(this->isa_instptr(), "must be an instance ptr.");
2983 




2943 
2944 //=============================================================================
2945 // Convenience common pre-built type.
2946 const TypeOopPtr *TypeOopPtr::BOTTOM;
2947 
2948 //------------------------------TypeOopPtr-------------------------------------
2949 TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset,
2950                        int instance_id, const TypePtr* speculative, int inline_depth)
2951   : TypePtr(t, ptr, offset, speculative, inline_depth),
2952     _const_oop(o), _klass(k),
2953     _klass_is_exact(xk),
2954     _is_ptr_to_narrowoop(false),
2955     _is_ptr_to_narrowklass(false),
2956     _is_ptr_to_boxed_value(false),
2957     _instance_id(instance_id) {
2958   if (Compile::current()->eliminate_boxing() && (t == InstPtr) &&
2959       (offset > 0) && xk && (k != 0) && k->is_instance_klass()) {
2960     _is_ptr_to_boxed_value = k->as_instance_klass()->is_boxed_value_offset(offset);
2961   }
2962 #ifdef _LP64
2963   if (_offset > 0 || _offset == Type::OffsetTop || _offset == Type::OffsetBot) {
2964     if (_offset == oopDesc::klass_offset_in_bytes()) {
2965       _is_ptr_to_narrowklass = UseCompressedClassPointers;
2966     } else if (klass() == NULL) {
2967       // Array with unknown body type
2968       assert(this->isa_aryptr(), "only arrays without klass");
2969       _is_ptr_to_narrowoop = UseCompressedOops;
2970     } else if (this->isa_aryptr()) {
2971       _is_ptr_to_narrowoop = (UseCompressedOops && klass()->is_obj_array_klass() &&
2972                              _offset != arrayOopDesc::length_offset_in_bytes());
2973     } else if (klass()->is_instance_klass()) {
2974       ciInstanceKlass* ik = klass()->as_instance_klass();
2975       ciField* field = NULL;
2976       if (this->isa_klassptr()) {
2977         // Perm objects don't use compressed references
2978       } else if (_offset == OffsetBot || _offset == OffsetTop) {
2979         // unsafe access
2980         _is_ptr_to_narrowoop = UseCompressedOops;
2981       } else { // exclude unsafe ops
2982         assert(this->isa_instptr(), "must be an instance ptr.");
2983 


< prev index next >