< prev index next >

src/share/vm/opto/type.cpp

Print this page




3736 const Type *TypeAryPtr::cast_to_ptr_type(PTR ptr) const {
3737   if( ptr == _ptr ) return this;
3738   return make(ptr, const_oop(), _ary, klass(), klass_is_exact(), _offset, _instance_id, _speculative, _inline_depth);
3739 }
3740 
3741 
3742 //-----------------------------cast_to_exactness-------------------------------
3743 const Type *TypeAryPtr::cast_to_exactness(bool klass_is_exact) const {
3744   if( klass_is_exact == _klass_is_exact ) return this;
3745   if (!UseExactTypes)  return this;
3746   if (_ary->ary_must_be_exact())  return this;  // cannot clear xk
3747   return make(ptr(), const_oop(), _ary, klass(), klass_is_exact, _offset, _instance_id, _speculative, _inline_depth);
3748 }
3749 
3750 //-----------------------------cast_to_instance_id----------------------------
3751 const TypeOopPtr *TypeAryPtr::cast_to_instance_id(int instance_id) const {
3752   if( instance_id == _instance_id ) return this;
3753   return make(_ptr, const_oop(), _ary, klass(), _klass_is_exact, _offset, instance_id, _speculative, _inline_depth);
3754 }
3755 

3756 //-----------------------------max_array_length-------------------------------
3757 // A wrapper around arrayOopDesc::max_array_length(etype) with some input normalization.
3758 jint TypeAryPtr::max_array_length(BasicType etype) {
3759   if (!is_java_primitive(etype) && !is_reference_type(etype)) {
3760     if (etype == T_NARROWOOP) {
3761       etype = T_OBJECT;
3762     } else if (etype == T_ILLEGAL) { // bottom[]
3763       etype = T_BYTE; // will produce conservatively high value
3764     } else {
3765       fatal(err_msg("not an element type: %s", type2name(etype)));
3766     }
3767   }
3768   return arrayOopDesc::max_array_length(etype);
3769 }
3770 
3771 //-----------------------------narrow_size_type-------------------------------
3772 // Narrow the given size type to the index range for the given array base type.
3773 // Return NULL if the resulting int type becomes empty.
3774 const TypeInt* TypeAryPtr::narrow_size_type(const TypeInt* size) const {
3775   jint hi = size->_hi;




3736 const Type *TypeAryPtr::cast_to_ptr_type(PTR ptr) const {
3737   if( ptr == _ptr ) return this;
3738   return make(ptr, const_oop(), _ary, klass(), klass_is_exact(), _offset, _instance_id, _speculative, _inline_depth);
3739 }
3740 
3741 
3742 //-----------------------------cast_to_exactness-------------------------------
3743 const Type *TypeAryPtr::cast_to_exactness(bool klass_is_exact) const {
3744   if( klass_is_exact == _klass_is_exact ) return this;
3745   if (!UseExactTypes)  return this;
3746   if (_ary->ary_must_be_exact())  return this;  // cannot clear xk
3747   return make(ptr(), const_oop(), _ary, klass(), klass_is_exact, _offset, _instance_id, _speculative, _inline_depth);
3748 }
3749 
3750 //-----------------------------cast_to_instance_id----------------------------
3751 const TypeOopPtr *TypeAryPtr::cast_to_instance_id(int instance_id) const {
3752   if( instance_id == _instance_id ) return this;
3753   return make(_ptr, const_oop(), _ary, klass(), _klass_is_exact, _offset, instance_id, _speculative, _inline_depth);
3754 }
3755 
3756 
3757 //-----------------------------max_array_length-------------------------------
3758 // A wrapper around arrayOopDesc::max_array_length(etype) with some input normalization.
3759 jint TypeAryPtr::max_array_length(BasicType etype) {
3760   if (!is_java_primitive(etype) && !is_reference_type(etype)) {
3761     if (etype == T_NARROWOOP) {
3762       etype = T_OBJECT;
3763     } else if (etype == T_ILLEGAL) { // bottom[]
3764       etype = T_BYTE; // will produce conservatively high value
3765     } else {
3766       fatal(err_msg("not an element type: %s", type2name(etype)));
3767     }
3768   }
3769   return arrayOopDesc::max_array_length(etype);
3770 }
3771 
3772 //-----------------------------narrow_size_type-------------------------------
3773 // Narrow the given size type to the index range for the given array base type.
3774 // Return NULL if the resulting int type becomes empty.
3775 const TypeInt* TypeAryPtr::narrow_size_type(const TypeInt* size) const {
3776   jint hi = size->_hi;


< prev index next >