< prev index next >

src/share/vm/opto/type.hpp

Print this page




 953   bool klass_is_exact()    const { return _klass_is_exact; }
 954 
 955   // Returns true if this pointer points at memory which contains a
 956   // compressed oop references.
 957   bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; }
 958   bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; }
 959   bool is_ptr_to_boxed_value()   const { return _is_ptr_to_boxed_value; }
 960   bool is_known_instance()       const { return _instance_id > 0; }
 961   int  instance_id()             const { return _instance_id; }
 962   bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; }
 963   virtual const TypeOopPtr* speculative() const { return _speculative; }
 964 
 965   virtual intptr_t get_con() const;
 966 
 967   virtual const Type *cast_to_ptr_type(PTR ptr) const;
 968 
 969   virtual const Type *cast_to_exactness(bool klass_is_exact) const;
 970 
 971   virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
 972 


 973   // corresponding pointer to klass, for a given instance
 974   const TypeKlassPtr* as_klass_type() const;
 975 
 976   virtual const TypePtr *add_offset( intptr_t offset ) const;
 977   // Return same type without a speculative part
 978   virtual const Type* remove_speculative() const;
 979 
 980   virtual const Type *xmeet(const Type *t) const;
 981   virtual const Type *xdual() const;    // Compute dual right now.
 982   // the core of the computation of the meet for TypeOopPtr and for its subclasses
 983   virtual const Type *xmeet_helper(const Type *t) const;
 984 
 985   // Convenience common pre-built type.
 986   static const TypeOopPtr *BOTTOM;
 987 #ifndef PRODUCT
 988   virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
 989 #endif
 990 
 991   // Return the speculative type if any
 992   ciKlass* speculative_type() const {


1044     return make(ptr, klass, false, NULL, offset, InstanceBot);
1045   }
1046 
1047   // Make a pointer to an oop.
1048   static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom);
1049 
1050   /** Create constant type for a constant boxed value */
1051   const Type* get_const_boxed_value() const;
1052 
1053   // If this is a java.lang.Class constant, return the type for it or NULL.
1054   // Pass to Type::get_const_type to turn it to a type, which will usually
1055   // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc.
1056   ciType* java_mirror_type() const;
1057 
1058   virtual const Type *cast_to_ptr_type(PTR ptr) const;
1059 
1060   virtual const Type *cast_to_exactness(bool klass_is_exact) const;
1061 
1062   virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
1063 


1064   virtual const TypePtr *add_offset( intptr_t offset ) const;
1065   // Return same type without a speculative part
1066   virtual const Type* remove_speculative() const;
1067   virtual const TypeOopPtr* with_inline_depth(int depth) const;
1068 
1069   // the core of the computation of the meet of 2 types
1070   virtual const Type *xmeet_helper(const Type *t) const;
1071   virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const;
1072   virtual const Type *xdual() const;    // Compute dual right now.
1073 
1074   // Convenience common pre-built types.
1075   static const TypeInstPtr *NOTNULL;
1076   static const TypeInstPtr *BOTTOM;
1077   static const TypeInstPtr *MIRROR;
1078   static const TypeInstPtr *MARK;
1079   static const TypeInstPtr *KLASS;
1080 #ifndef PRODUCT
1081   virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
1082 #endif
1083 };


1119   // Accessors
1120   ciKlass* klass() const;
1121   const TypeAry* ary() const  { return _ary; }
1122   const Type*    elem() const { return _ary->_elem; }
1123   const TypeInt* size() const { return _ary->_size; }
1124   bool      is_stable() const { return _ary->_stable; }
1125 
1126   bool is_autobox_cache() const { return _is_autobox_cache; }
1127 
1128   static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom);
1129   // Constant pointer to array
1130   static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom, bool is_autobox_cache= false);
1131 
1132   // Return a 'ptr' version of this type
1133   virtual const Type *cast_to_ptr_type(PTR ptr) const;
1134 
1135   virtual const Type *cast_to_exactness(bool klass_is_exact) const;
1136 
1137   virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
1138 


1139   virtual const TypeAryPtr* cast_to_size(const TypeInt* size) const;
1140   virtual const TypeInt* narrow_size_type(const TypeInt* size) const;
1141 
1142   virtual bool empty(void) const;        // TRUE if type is vacuous
1143   virtual const TypePtr *add_offset( intptr_t offset ) const;
1144   // Return same type without a speculative part
1145   virtual const Type* remove_speculative() const;
1146   virtual const TypeOopPtr* with_inline_depth(int depth) const;
1147 
1148   // the core of the computation of the meet of 2 types
1149   virtual const Type *xmeet_helper(const Type *t) const;
1150   virtual const Type *xdual() const;    // Compute dual right now.
1151 
1152   const TypeAryPtr* cast_to_stable(bool stable, int stable_dimension = 1) const;
1153   int stable_dimension() const;
1154 
1155   // Convenience common pre-built types.
1156   static const TypeAryPtr *RANGE;
1157   static const TypeAryPtr *OOPS;
1158   static const TypeAryPtr *NARROWOOPS;


1629 inline const TypeMetadataPtr *Type::isa_metadataptr() const {
1630   return (_base == MetadataPtr) ? (TypeMetadataPtr*)this : NULL;
1631 }
1632 
1633 inline const TypeKlassPtr *Type::isa_klassptr() const {
1634   return (_base == KlassPtr) ? (TypeKlassPtr*)this : NULL;
1635 }
1636 
1637 inline const TypeKlassPtr *Type::is_klassptr() const {
1638   assert( _base == KlassPtr, "Not a klass pointer" );
1639   return (TypeKlassPtr*)this;
1640 }
1641 
1642 inline const TypePtr* Type::make_ptr() const {
1643   return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype() :
1644     ((_base == NarrowKlass) ? is_narrowklass()->get_ptrtype() :
1645      (isa_ptr() ? is_ptr() : NULL));
1646 }
1647 
1648 inline const TypeOopPtr* Type::make_oopptr() const {
1649   return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype()->is_oopptr() : is_oopptr();
1650 }
1651 
1652 inline const TypeNarrowOop* Type::make_narrowoop() const {
1653   return (_base == NarrowOop) ? is_narrowoop() :
1654                                 (isa_ptr() ? TypeNarrowOop::make(is_ptr()) : NULL);
1655 }
1656 
1657 inline const TypeNarrowKlass* Type::make_narrowklass() const {
1658   return (_base == NarrowKlass) ? is_narrowklass() :
1659                                 (isa_ptr() ? TypeNarrowKlass::make(is_ptr()) : NULL);
1660 }
1661 
1662 inline bool Type::is_floatingpoint() const {
1663   if( (_base == FloatCon)  || (_base == FloatBot) ||
1664       (_base == DoubleCon) || (_base == DoubleBot) )
1665     return true;
1666   return false;
1667 }
1668 
1669 inline bool Type::is_ptr_to_boxing_obj() const {




 953   bool klass_is_exact()    const { return _klass_is_exact; }
 954 
 955   // Returns true if this pointer points at memory which contains a
 956   // compressed oop references.
 957   bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; }
 958   bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; }
 959   bool is_ptr_to_boxed_value()   const { return _is_ptr_to_boxed_value; }
 960   bool is_known_instance()       const { return _instance_id > 0; }
 961   int  instance_id()             const { return _instance_id; }
 962   bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; }
 963   virtual const TypeOopPtr* speculative() const { return _speculative; }
 964 
 965   virtual intptr_t get_con() const;
 966 
 967   virtual const Type *cast_to_ptr_type(PTR ptr) const;
 968 
 969   virtual const Type *cast_to_exactness(bool klass_is_exact) const;
 970 
 971   virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
 972 
 973   virtual const TypeOopPtr *cast_to_nonconst() const;
 974 
 975   // corresponding pointer to klass, for a given instance
 976   const TypeKlassPtr* as_klass_type() const;
 977 
 978   virtual const TypePtr *add_offset( intptr_t offset ) const;
 979   // Return same type without a speculative part
 980   virtual const Type* remove_speculative() const;
 981 
 982   virtual const Type *xmeet(const Type *t) const;
 983   virtual const Type *xdual() const;    // Compute dual right now.
 984   // the core of the computation of the meet for TypeOopPtr and for its subclasses
 985   virtual const Type *xmeet_helper(const Type *t) const;
 986 
 987   // Convenience common pre-built type.
 988   static const TypeOopPtr *BOTTOM;
 989 #ifndef PRODUCT
 990   virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
 991 #endif
 992 
 993   // Return the speculative type if any
 994   ciKlass* speculative_type() const {


1046     return make(ptr, klass, false, NULL, offset, InstanceBot);
1047   }
1048 
1049   // Make a pointer to an oop.
1050   static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom);
1051 
1052   /** Create constant type for a constant boxed value */
1053   const Type* get_const_boxed_value() const;
1054 
1055   // If this is a java.lang.Class constant, return the type for it or NULL.
1056   // Pass to Type::get_const_type to turn it to a type, which will usually
1057   // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc.
1058   ciType* java_mirror_type() const;
1059 
1060   virtual const Type *cast_to_ptr_type(PTR ptr) const;
1061 
1062   virtual const Type *cast_to_exactness(bool klass_is_exact) const;
1063 
1064   virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
1065 
1066   virtual const TypeOopPtr *cast_to_nonconst() const;
1067 
1068   virtual const TypePtr *add_offset( intptr_t offset ) const;
1069   // Return same type without a speculative part
1070   virtual const Type* remove_speculative() const;
1071   virtual const TypeOopPtr* with_inline_depth(int depth) const;
1072 
1073   // the core of the computation of the meet of 2 types
1074   virtual const Type *xmeet_helper(const Type *t) const;
1075   virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const;
1076   virtual const Type *xdual() const;    // Compute dual right now.
1077 
1078   // Convenience common pre-built types.
1079   static const TypeInstPtr *NOTNULL;
1080   static const TypeInstPtr *BOTTOM;
1081   static const TypeInstPtr *MIRROR;
1082   static const TypeInstPtr *MARK;
1083   static const TypeInstPtr *KLASS;
1084 #ifndef PRODUCT
1085   virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
1086 #endif
1087 };


1123   // Accessors
1124   ciKlass* klass() const;
1125   const TypeAry* ary() const  { return _ary; }
1126   const Type*    elem() const { return _ary->_elem; }
1127   const TypeInt* size() const { return _ary->_size; }
1128   bool      is_stable() const { return _ary->_stable; }
1129 
1130   bool is_autobox_cache() const { return _is_autobox_cache; }
1131 
1132   static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom);
1133   // Constant pointer to array
1134   static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom, bool is_autobox_cache= false);
1135 
1136   // Return a 'ptr' version of this type
1137   virtual const Type *cast_to_ptr_type(PTR ptr) const;
1138 
1139   virtual const Type *cast_to_exactness(bool klass_is_exact) const;
1140 
1141   virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
1142 
1143   virtual const TypeOopPtr *cast_to_nonconst() const;
1144 
1145   virtual const TypeAryPtr* cast_to_size(const TypeInt* size) const;
1146   virtual const TypeInt* narrow_size_type(const TypeInt* size) const;
1147 
1148   virtual bool empty(void) const;        // TRUE if type is vacuous
1149   virtual const TypePtr *add_offset( intptr_t offset ) const;
1150   // Return same type without a speculative part
1151   virtual const Type* remove_speculative() const;
1152   virtual const TypeOopPtr* with_inline_depth(int depth) const;
1153 
1154   // the core of the computation of the meet of 2 types
1155   virtual const Type *xmeet_helper(const Type *t) const;
1156   virtual const Type *xdual() const;    // Compute dual right now.
1157 
1158   const TypeAryPtr* cast_to_stable(bool stable, int stable_dimension = 1) const;
1159   int stable_dimension() const;
1160 
1161   // Convenience common pre-built types.
1162   static const TypeAryPtr *RANGE;
1163   static const TypeAryPtr *OOPS;
1164   static const TypeAryPtr *NARROWOOPS;


1635 inline const TypeMetadataPtr *Type::isa_metadataptr() const {
1636   return (_base == MetadataPtr) ? (TypeMetadataPtr*)this : NULL;
1637 }
1638 
1639 inline const TypeKlassPtr *Type::isa_klassptr() const {
1640   return (_base == KlassPtr) ? (TypeKlassPtr*)this : NULL;
1641 }
1642 
1643 inline const TypeKlassPtr *Type::is_klassptr() const {
1644   assert( _base == KlassPtr, "Not a klass pointer" );
1645   return (TypeKlassPtr*)this;
1646 }
1647 
1648 inline const TypePtr* Type::make_ptr() const {
1649   return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype() :
1650     ((_base == NarrowKlass) ? is_narrowklass()->get_ptrtype() :
1651      (isa_ptr() ? is_ptr() : NULL));
1652 }
1653 
1654 inline const TypeOopPtr* Type::make_oopptr() const {
1655   return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype()->is_oopptr() : isa_oopptr();
1656 }
1657 
1658 inline const TypeNarrowOop* Type::make_narrowoop() const {
1659   return (_base == NarrowOop) ? is_narrowoop() :
1660                                 (isa_ptr() ? TypeNarrowOop::make(is_ptr()) : NULL);
1661 }
1662 
1663 inline const TypeNarrowKlass* Type::make_narrowklass() const {
1664   return (_base == NarrowKlass) ? is_narrowklass() :
1665                                 (isa_ptr() ? TypeNarrowKlass::make(is_ptr()) : NULL);
1666 }
1667 
1668 inline bool Type::is_floatingpoint() const {
1669   if( (_base == FloatCon)  || (_base == FloatBot) ||
1670       (_base == DoubleCon) || (_base == DoubleBot) )
1671     return true;
1672   return false;
1673 }
1674 
1675 inline bool Type::is_ptr_to_boxing_obj() const {


< prev index next >