< prev index next >

src/hotspot/share/opto/type.hpp

Print this page

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











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

1372 };
1373 
1374 //------------------------------TypeAryPtr-------------------------------------
1375 // Class of Java array pointers
1376 class TypeAryPtr : public TypeOopPtr {
1377   friend class Type;
1378   friend class TypePtr;
1379 
1380   TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1381               int offset, int instance_id, bool is_autobox_cache,
1382               const TypePtr* speculative, int inline_depth)
1383     : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1384     _ary(ary),
1385     _is_autobox_cache(is_autobox_cache)
1386  {
1387     int dummy;
1388     bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1389 
1390     if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1391         _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1392         _offset != arrayOopDesc::klass_offset_in_bytes()) {
1393       _is_ptr_to_narrowoop = true;
1394     }
1395 
1396   }
1397   virtual bool eq( const Type *t ) const;
1398   virtual uint hash() const;    // Type specific hashing
1399   const TypeAry *_ary;          // Array we point into
1400   const bool     _is_autobox_cache;
1401 
1402   ciKlass* compute_klass() const;
1403 
1404   // A pointer to delay allocation to Type::Initialize_shared()
1405 
1406   static const TypeInterfaces* _array_interfaces;
1407   ciKlass* exact_klass_helper() const;
1408   // Only guaranteed non null for array of basic types
1409   ciKlass* klass() const;
1410 
1411 public:
1412 

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

1383 };
1384 
1385 //------------------------------TypeAryPtr-------------------------------------
1386 // Class of Java array pointers
1387 class TypeAryPtr : public TypeOopPtr {
1388   friend class Type;
1389   friend class TypePtr;
1390 
1391   TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1392               int offset, int instance_id, bool is_autobox_cache,
1393               const TypePtr* speculative, int inline_depth)
1394     : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1395     _ary(ary),
1396     _is_autobox_cache(is_autobox_cache)
1397  {
1398     int dummy;
1399     bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1400 
1401     if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1402         _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1403         _offset != Type::klass_offset()) {
1404       _is_ptr_to_narrowoop = true;
1405     }
1406 
1407   }
1408   virtual bool eq( const Type *t ) const;
1409   virtual uint hash() const;    // Type specific hashing
1410   const TypeAry *_ary;          // Array we point into
1411   const bool     _is_autobox_cache;
1412 
1413   ciKlass* compute_klass() const;
1414 
1415   // A pointer to delay allocation to Type::Initialize_shared()
1416 
1417   static const TypeInterfaces* _array_interfaces;
1418   ciKlass* exact_klass_helper() const;
1419   // Only guaranteed non null for array of basic types
1420   ciKlass* klass() const;
1421 
1422 public:
1423 
< prev index next >