< prev index next >

src/share/vm/opto/type.cpp

Print this page




3760 const Type *TypeAryPtr::cast_to_ptr_type(PTR ptr) const {
3761   if( ptr == _ptr ) return this;
3762   return make(ptr, const_oop(), _ary, klass(), klass_is_exact(), _offset, _instance_id, _speculative, _inline_depth);
3763 }
3764 
3765 
3766 //-----------------------------cast_to_exactness-------------------------------
3767 const Type *TypeAryPtr::cast_to_exactness(bool klass_is_exact) const {
3768   if( klass_is_exact == _klass_is_exact ) return this;
3769   if (!UseExactTypes)  return this;
3770   if (_ary->ary_must_be_exact())  return this;  // cannot clear xk
3771   return make(ptr(), const_oop(), _ary, klass(), klass_is_exact, _offset, _instance_id, _speculative, _inline_depth);
3772 }
3773 
3774 //-----------------------------cast_to_instance_id----------------------------
3775 const TypeOopPtr *TypeAryPtr::cast_to_instance_id(int instance_id) const {
3776   if( instance_id == _instance_id ) return this;
3777   return make(_ptr, const_oop(), _ary, klass(), _klass_is_exact, _offset, instance_id, _speculative, _inline_depth);
3778 }
3779 

3780 //-----------------------------max_array_length-------------------------------
3781 // A wrapper around arrayOopDesc::max_array_length(etype) with some input normalization.
3782 jint TypeAryPtr::max_array_length(BasicType etype) {
3783   if (!is_java_primitive(etype) && !is_reference_type(etype)) {
3784     if (etype == T_NARROWOOP) {
3785       etype = T_OBJECT;
3786     } else if (etype == T_ILLEGAL) { // bottom[]
3787       etype = T_BYTE; // will produce conservatively high value
3788     } else {
3789       fatal(err_msg("not an element type: %s", type2name(etype)));
3790     }
3791   }
3792   return arrayOopDesc::max_array_length(etype);
3793 }
3794 
3795 //-----------------------------narrow_size_type-------------------------------
3796 // Narrow the given size type to the index range for the given array base type.
3797 // Return NULL if the resulting int type becomes empty.
3798 const TypeInt* TypeAryPtr::narrow_size_type(const TypeInt* size) const {
3799   jint hi = size->_hi;




3760 const Type *TypeAryPtr::cast_to_ptr_type(PTR ptr) const {
3761   if( ptr == _ptr ) return this;
3762   return make(ptr, const_oop(), _ary, klass(), klass_is_exact(), _offset, _instance_id, _speculative, _inline_depth);
3763 }
3764 
3765 
3766 //-----------------------------cast_to_exactness-------------------------------
3767 const Type *TypeAryPtr::cast_to_exactness(bool klass_is_exact) const {
3768   if( klass_is_exact == _klass_is_exact ) return this;
3769   if (!UseExactTypes)  return this;
3770   if (_ary->ary_must_be_exact())  return this;  // cannot clear xk
3771   return make(ptr(), const_oop(), _ary, klass(), klass_is_exact, _offset, _instance_id, _speculative, _inline_depth);
3772 }
3773 
3774 //-----------------------------cast_to_instance_id----------------------------
3775 const TypeOopPtr *TypeAryPtr::cast_to_instance_id(int instance_id) const {
3776   if( instance_id == _instance_id ) return this;
3777   return make(_ptr, const_oop(), _ary, klass(), _klass_is_exact, _offset, instance_id, _speculative, _inline_depth);
3778 }
3779 
3780 
3781 //-----------------------------max_array_length-------------------------------
3782 // A wrapper around arrayOopDesc::max_array_length(etype) with some input normalization.
3783 jint TypeAryPtr::max_array_length(BasicType etype) {
3784   if (!is_java_primitive(etype) && !is_reference_type(etype)) {
3785     if (etype == T_NARROWOOP) {
3786       etype = T_OBJECT;
3787     } else if (etype == T_ILLEGAL) { // bottom[]
3788       etype = T_BYTE; // will produce conservatively high value
3789     } else {
3790       fatal(err_msg("not an element type: %s", type2name(etype)));
3791     }
3792   }
3793   return arrayOopDesc::max_array_length(etype);
3794 }
3795 
3796 //-----------------------------narrow_size_type-------------------------------
3797 // Narrow the given size type to the index range for the given array base type.
3798 // Return NULL if the resulting int type becomes empty.
3799 const TypeInt* TypeAryPtr::narrow_size_type(const TypeInt* size) const {
3800   jint hi = size->_hi;


< prev index next >