182 const Type *meet_helper(const Type *t, bool include_speculative) const;
183 void check_symmetrical(const Type* t, const Type* mt, const VerifyMeet& verify) const NOT_DEBUG_RETURN;
184
185 protected:
186 // Each class of type is also identified by its base.
187 const TYPES _base; // Enum of Types type
188
189 Type( TYPES t ) : _dual(nullptr), _base(t) {} // Simple types
190 // ~Type(); // Use fast deallocation
191 const Type *hashcons(); // Hash-cons the type
192 virtual const Type *filter_helper(const Type *kills, bool include_speculative) const;
193 const Type *join_helper(const Type *t, bool include_speculative) const {
194 assert_type_verify_empty();
195 return dual()->meet_helper(t->dual(), include_speculative)->dual();
196 }
197
198 void assert_type_verify_empty() const NOT_DEBUG_RETURN;
199
200 public:
201
202 inline void* operator new( size_t x ) throw() {
203 Compile* compile = Compile::current();
204 compile->set_type_last_size(x);
205 return compile->type_arena()->AmallocWords(x);
206 }
207 inline void operator delete( void* ptr ) {
208 Compile* compile = Compile::current();
209 compile->type_arena()->Afree(ptr,compile->type_last_size());
210 }
211
212 // Initialize the type system for a particular compilation.
213 static void Initialize(Compile* compile);
214
215 // Initialize the types shared by all compilations.
216 static void Initialize_shared(Compile* compile);
217
218 TYPES base() const {
219 assert(_base > Bad && _base < lastype, "sanity");
220 return _base;
221 }
1641
1642 //------------------------------TypeAryPtr-------------------------------------
1643 // Class of Java array pointers
1644 class TypeAryPtr : public TypeOopPtr {
1645 friend class Type;
1646 friend class TypePtr;
1647 friend class TypeInterfaces;
1648
1649 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1650 int offset, int instance_id, bool is_autobox_cache,
1651 const TypePtr* speculative, int inline_depth)
1652 : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1653 _ary(ary),
1654 _is_autobox_cache(is_autobox_cache)
1655 {
1656 int dummy;
1657 bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1658
1659 if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1660 _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1661 _offset != arrayOopDesc::klass_offset_in_bytes()) {
1662 _is_ptr_to_narrowoop = true;
1663 }
1664
1665 }
1666 virtual bool eq( const Type *t ) const;
1667 virtual uint hash() const; // Type specific hashing
1668 const TypeAry *_ary; // Array we point into
1669 const bool _is_autobox_cache;
1670
1671 ciKlass* compute_klass() const;
1672
1673 // A pointer to delay allocation to Type::Initialize_shared()
1674
1675 static const TypeInterfaces* _array_interfaces;
1676 ciKlass* exact_klass_helper() const;
1677 // Only guaranteed non null for array of basic types
1678 ciKlass* klass() const;
1679
1680 public:
1681
|
182 const Type *meet_helper(const Type *t, bool include_speculative) const;
183 void check_symmetrical(const Type* t, const Type* mt, const VerifyMeet& verify) const NOT_DEBUG_RETURN;
184
185 protected:
186 // Each class of type is also identified by its base.
187 const TYPES _base; // Enum of Types type
188
189 Type( TYPES t ) : _dual(nullptr), _base(t) {} // Simple types
190 // ~Type(); // Use fast deallocation
191 const Type *hashcons(); // Hash-cons the type
192 virtual const Type *filter_helper(const Type *kills, bool include_speculative) const;
193 const Type *join_helper(const Type *t, bool include_speculative) const {
194 assert_type_verify_empty();
195 return dual()->meet_helper(t->dual(), include_speculative)->dual();
196 }
197
198 void assert_type_verify_empty() const NOT_DEBUG_RETURN;
199
200 public:
201
202 // This is used as a marker to identify narrow Klass* loads, which
203 // are really extracted from the mark-word, but we still want to
204 // distinguish it.
205 static int klass_offset() {
206 if (UseCompactObjectHeaders) {
207 return 1;
208 } else {
209 return oopDesc::klass_offset_in_bytes();
210 }
211 }
212
213 inline void* operator new( size_t x ) throw() {
214 Compile* compile = Compile::current();
215 compile->set_type_last_size(x);
216 return compile->type_arena()->AmallocWords(x);
217 }
218 inline void operator delete( void* ptr ) {
219 Compile* compile = Compile::current();
220 compile->type_arena()->Afree(ptr,compile->type_last_size());
221 }
222
223 // Initialize the type system for a particular compilation.
224 static void Initialize(Compile* compile);
225
226 // Initialize the types shared by all compilations.
227 static void Initialize_shared(Compile* compile);
228
229 TYPES base() const {
230 assert(_base > Bad && _base < lastype, "sanity");
231 return _base;
232 }
1652
1653 //------------------------------TypeAryPtr-------------------------------------
1654 // Class of Java array pointers
1655 class TypeAryPtr : public TypeOopPtr {
1656 friend class Type;
1657 friend class TypePtr;
1658 friend class TypeInterfaces;
1659
1660 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1661 int offset, int instance_id, bool is_autobox_cache,
1662 const TypePtr* speculative, int inline_depth)
1663 : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1664 _ary(ary),
1665 _is_autobox_cache(is_autobox_cache)
1666 {
1667 int dummy;
1668 bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1669
1670 if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1671 _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1672 _offset != Type::klass_offset()) {
1673 _is_ptr_to_narrowoop = true;
1674 }
1675
1676 }
1677 virtual bool eq( const Type *t ) const;
1678 virtual uint hash() const; // Type specific hashing
1679 const TypeAry *_ary; // Array we point into
1680 const bool _is_autobox_cache;
1681
1682 ciKlass* compute_klass() const;
1683
1684 // A pointer to delay allocation to Type::Initialize_shared()
1685
1686 static const TypeInterfaces* _array_interfaces;
1687 ciKlass* exact_klass_helper() const;
1688 // Only guaranteed non null for array of basic types
1689 ciKlass* klass() const;
1690
1691 public:
1692
|