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