< prev index next >

src/hotspot/share/opto/type.hpp

Print this page

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











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

1418 
1419 //------------------------------TypeAryPtr-------------------------------------
1420 // Class of Java array pointers
1421 class TypeAryPtr : public TypeOopPtr {
1422   friend class Type;
1423   friend class TypePtr;
1424   friend class TypeInterfaces;
1425 
1426   TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1427               int offset, int instance_id, bool is_autobox_cache,
1428               const TypePtr* speculative, int inline_depth)
1429     : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1430     _ary(ary),
1431     _is_autobox_cache(is_autobox_cache)
1432  {
1433     int dummy;
1434     bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1435 
1436     if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1437         _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1438         _offset != arrayOopDesc::klass_offset_in_bytes()) {
1439       _is_ptr_to_narrowoop = true;
1440     }
1441 
1442   }
1443   virtual bool eq( const Type *t ) const;
1444   virtual uint hash() const;    // Type specific hashing
1445   const TypeAry *_ary;          // Array we point into
1446   const bool     _is_autobox_cache;
1447 
1448   ciKlass* compute_klass() const;
1449 
1450   // A pointer to delay allocation to Type::Initialize_shared()
1451 
1452   static const TypeInterfaces* _array_interfaces;
1453   ciKlass* exact_klass_helper() const;
1454   // Only guaranteed non null for array of basic types
1455   ciKlass* klass() const;
1456 
1457 public:
1458 

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

1429 
1430 //------------------------------TypeAryPtr-------------------------------------
1431 // Class of Java array pointers
1432 class TypeAryPtr : public TypeOopPtr {
1433   friend class Type;
1434   friend class TypePtr;
1435   friend class TypeInterfaces;
1436 
1437   TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1438               int offset, int instance_id, bool is_autobox_cache,
1439               const TypePtr* speculative, int inline_depth)
1440     : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1441     _ary(ary),
1442     _is_autobox_cache(is_autobox_cache)
1443  {
1444     int dummy;
1445     bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1446 
1447     if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1448         _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1449         _offset != Type::klass_offset()) {
1450       _is_ptr_to_narrowoop = true;
1451     }
1452 
1453   }
1454   virtual bool eq( const Type *t ) const;
1455   virtual uint hash() const;    // Type specific hashing
1456   const TypeAry *_ary;          // Array we point into
1457   const bool     _is_autobox_cache;
1458 
1459   ciKlass* compute_klass() const;
1460 
1461   // A pointer to delay allocation to Type::Initialize_shared()
1462 
1463   static const TypeInterfaces* _array_interfaces;
1464   ciKlass* exact_klass_helper() const;
1465   // Only guaranteed non null for array of basic types
1466   ciKlass* klass() const;
1467 
1468 public:
1469 
< prev index next >