< 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   }

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

 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   }

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