< prev index next >

src/hotspot/share/opto/type.hpp

Print this page

 183   const Type *meet_helper(const Type *t, bool include_speculative) const;
 184   void check_symmetrical(const Type* t, const Type* mt, const VerifyMeet& verify) const NOT_DEBUG_RETURN;
 185 
 186 protected:
 187   // Each class of type is also identified by its base.
 188   const TYPES _base;            // Enum of Types type
 189 
 190   Type( TYPES t ) : _dual(nullptr),  _base(t) {} // Simple types
 191   // ~Type();                   // Use fast deallocation
 192   const Type *hashcons();       // Hash-cons the type
 193   virtual const Type *filter_helper(const Type *kills, bool include_speculative) const;
 194   const Type *join_helper(const Type *t, bool include_speculative) const {
 195     assert_type_verify_empty();
 196     return dual()->meet_helper(t->dual(), include_speculative)->dual();
 197   }
 198 
 199   void assert_type_verify_empty() const NOT_DEBUG_RETURN;
 200 
 201 public:
 202 











 203   inline void* operator new( size_t x ) throw() {
 204     Compile* compile = Compile::current();
 205     compile->set_type_last_size(x);
 206     return compile->type_arena()->AmallocWords(x);
 207   }
 208   inline void operator delete( void* ptr ) {
 209     Compile* compile = Compile::current();
 210     compile->type_arena()->Afree(ptr,compile->type_last_size());
 211   }
 212 
 213   // Initialize the type system for a particular compilation.
 214   static void Initialize(Compile* compile);
 215 
 216   // Initialize the types shared by all compilations.
 217   static void Initialize_shared(Compile* compile);
 218 
 219   TYPES base() const {
 220     assert(_base > Bad && _base < lastype, "sanity");
 221     return _base;
 222   }

1634 
1635 //------------------------------TypeAryPtr-------------------------------------
1636 // Class of Java array pointers
1637 class TypeAryPtr : public TypeOopPtr {
1638   friend class Type;
1639   friend class TypePtr;
1640   friend class TypeInterfaces;
1641 
1642   TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1643               int offset, int instance_id, bool is_autobox_cache,
1644               const TypePtr* speculative, int inline_depth)
1645     : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1646     _ary(ary),
1647     _is_autobox_cache(is_autobox_cache)
1648  {
1649     int dummy;
1650     bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1651 
1652     if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1653         _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1654         _offset != arrayOopDesc::klass_offset_in_bytes()) {
1655       _is_ptr_to_narrowoop = true;
1656     }
1657 
1658   }
1659   virtual bool eq( const Type *t ) const;
1660   virtual uint hash() const;    // Type specific hashing
1661   const TypeAry *_ary;          // Array we point into
1662   const bool     _is_autobox_cache;
1663 
1664   ciKlass* compute_klass() const;
1665 
1666   // A pointer to delay allocation to Type::Initialize_shared()
1667 
1668   static const TypeInterfaces* _array_interfaces;
1669   ciKlass* exact_klass_helper() const;
1670   // Only guaranteed non null for array of basic types
1671   ciKlass* klass() const;
1672 
1673 public:
1674 

 183   const Type *meet_helper(const Type *t, bool include_speculative) const;
 184   void check_symmetrical(const Type* t, const Type* mt, const VerifyMeet& verify) const NOT_DEBUG_RETURN;
 185 
 186 protected:
 187   // Each class of type is also identified by its base.
 188   const TYPES _base;            // Enum of Types type
 189 
 190   Type( TYPES t ) : _dual(nullptr),  _base(t) {} // Simple types
 191   // ~Type();                   // Use fast deallocation
 192   const Type *hashcons();       // Hash-cons the type
 193   virtual const Type *filter_helper(const Type *kills, bool include_speculative) const;
 194   const Type *join_helper(const Type *t, bool include_speculative) const {
 195     assert_type_verify_empty();
 196     return dual()->meet_helper(t->dual(), include_speculative)->dual();
 197   }
 198 
 199   void assert_type_verify_empty() const NOT_DEBUG_RETURN;
 200 
 201 public:
 202 
 203   // This is used as a marker to identify narrow Klass* loads, which
 204   // are really extracted from the mark-word, but we still want to
 205   // distinguish it.
 206   static int klass_offset() {
 207     if (UseCompactObjectHeaders) {
 208       return 1;
 209     } else {
 210       return oopDesc::klass_offset_in_bytes();
 211     }
 212   }
 213 
 214   inline void* operator new( size_t x ) throw() {
 215     Compile* compile = Compile::current();
 216     compile->set_type_last_size(x);
 217     return compile->type_arena()->AmallocWords(x);
 218   }
 219   inline void operator delete( void* ptr ) {
 220     Compile* compile = Compile::current();
 221     compile->type_arena()->Afree(ptr,compile->type_last_size());
 222   }
 223 
 224   // Initialize the type system for a particular compilation.
 225   static void Initialize(Compile* compile);
 226 
 227   // Initialize the types shared by all compilations.
 228   static void Initialize_shared(Compile* compile);
 229 
 230   TYPES base() const {
 231     assert(_base > Bad && _base < lastype, "sanity");
 232     return _base;
 233   }

1645 
1646 //------------------------------TypeAryPtr-------------------------------------
1647 // Class of Java array pointers
1648 class TypeAryPtr : public TypeOopPtr {
1649   friend class Type;
1650   friend class TypePtr;
1651   friend class TypeInterfaces;
1652 
1653   TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1654               int offset, int instance_id, bool is_autobox_cache,
1655               const TypePtr* speculative, int inline_depth)
1656     : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1657     _ary(ary),
1658     _is_autobox_cache(is_autobox_cache)
1659  {
1660     int dummy;
1661     bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1662 
1663     if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1664         _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1665         _offset != Type::klass_offset()) {
1666       _is_ptr_to_narrowoop = true;
1667     }
1668 
1669   }
1670   virtual bool eq( const Type *t ) const;
1671   virtual uint hash() const;    // Type specific hashing
1672   const TypeAry *_ary;          // Array we point into
1673   const bool     _is_autobox_cache;
1674 
1675   ciKlass* compute_klass() const;
1676 
1677   // A pointer to delay allocation to Type::Initialize_shared()
1678 
1679   static const TypeInterfaces* _array_interfaces;
1680   ciKlass* exact_klass_helper() const;
1681   // Only guaranteed non null for array of basic types
1682   ciKlass* klass() const;
1683 
1684 public:
1685 
< prev index next >