< prev index next >

src/share/vm/opto/type.hpp

Print this page




 955   bool klass_is_exact()    const { return _klass_is_exact; }
 956 
 957   // Returns true if this pointer points at memory which contains a
 958   // compressed oop references.
 959   bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; }
 960   bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; }
 961   bool is_ptr_to_boxed_value()   const { return _is_ptr_to_boxed_value; }
 962   bool is_known_instance()       const { return _instance_id > 0; }
 963   int  instance_id()             const { return _instance_id; }
 964   bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; }
 965   virtual const TypeOopPtr* speculative() const { return _speculative; }
 966 
 967   virtual intptr_t get_con() const;
 968 
 969   virtual const Type *cast_to_ptr_type(PTR ptr) const;
 970 
 971   virtual const Type *cast_to_exactness(bool klass_is_exact) const;
 972 
 973   virtual const TypeOopPtr *cast_to_instance_id(int instance_id) 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 TypePtr *add_offset( intptr_t offset ) const;
1067   // Return same type without a speculative part
1068   virtual const Type* remove_speculative() const;
1069   virtual const TypeOopPtr* with_inline_depth(int depth) const;
1070 
1071   // the core of the computation of the meet of 2 types
1072   virtual const Type *xmeet_helper(const Type *t) const;
1073   virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const;
1074   virtual const Type *xdual() const;    // Compute dual right now.
1075 
1076   // Convenience common pre-built types.
1077   static const TypeInstPtr *NOTNULL;
1078   static const TypeInstPtr *BOTTOM;
1079   static const TypeInstPtr *MIRROR;
1080   static const TypeInstPtr *MARK;
1081   static const TypeInstPtr *KLASS;
1082 #ifndef PRODUCT
1083   virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
1084 #endif
1085 };


1121   // Accessors
1122   ciKlass* klass() const;
1123   const TypeAry* ary() const  { return _ary; }
1124   const Type*    elem() const { return _ary->_elem; }
1125   const TypeInt* size() const { return _ary->_size; }
1126   bool      is_stable() const { return _ary->_stable; }
1127 
1128   bool is_autobox_cache() const { return _is_autobox_cache; }
1129 
1130   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);
1131   // Constant pointer to array
1132   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);
1133 
1134   // Return a 'ptr' version of this type
1135   virtual const Type *cast_to_ptr_type(PTR ptr) const;
1136 
1137   virtual const Type *cast_to_exactness(bool klass_is_exact) const;
1138 
1139   virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
1140 


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


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




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


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


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


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


< prev index next >