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 }
1602
1603 //------------------------------TypeAryPtr-------------------------------------
1604 // Class of Java array pointers
1605 class TypeAryPtr : public TypeOopPtr {
1606 friend class Type;
1607 friend class TypePtr;
1608 friend class TypeInterfaces;
1609
1610 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1611 int offset, int instance_id, bool is_autobox_cache,
1612 const TypePtr* speculative, int inline_depth)
1613 : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1614 _ary(ary),
1615 _is_autobox_cache(is_autobox_cache)
1616 {
1617 int dummy;
1618 bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1619
1620 if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1621 _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1622 _offset != arrayOopDesc::klass_offset_in_bytes()) {
1623 _is_ptr_to_narrowoop = true;
1624 }
1625
1626 }
1627 virtual bool eq( const Type *t ) const;
1628 virtual uint hash() const; // Type specific hashing
1629 const TypeAry *_ary; // Array we point into
1630 const bool _is_autobox_cache;
1631
1632 ciKlass* compute_klass() const;
1633
1634 // A pointer to delay allocation to Type::Initialize_shared()
1635
1636 static const TypeInterfaces* _array_interfaces;
1637 ciKlass* exact_klass_helper() const;
1638 // Only guaranteed non null for array of basic types
1639 ciKlass* klass() const;
1640
1641 public:
1642
|
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 }
1613
1614 //------------------------------TypeAryPtr-------------------------------------
1615 // Class of Java array pointers
1616 class TypeAryPtr : public TypeOopPtr {
1617 friend class Type;
1618 friend class TypePtr;
1619 friend class TypeInterfaces;
1620
1621 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
1622 int offset, int instance_id, bool is_autobox_cache,
1623 const TypePtr* speculative, int inline_depth)
1624 : TypeOopPtr(AryPtr,ptr,k,_array_interfaces,xk,o,offset, instance_id, speculative, inline_depth),
1625 _ary(ary),
1626 _is_autobox_cache(is_autobox_cache)
1627 {
1628 int dummy;
1629 bool top_or_bottom = (base_element_type(dummy) == Type::TOP || base_element_type(dummy) == Type::BOTTOM);
1630
1631 if (UseCompressedOops && (elem()->make_oopptr() != nullptr && !top_or_bottom) &&
1632 _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes() &&
1633 _offset != Type::klass_offset()) {
1634 _is_ptr_to_narrowoop = true;
1635 }
1636
1637 }
1638 virtual bool eq( const Type *t ) const;
1639 virtual uint hash() const; // Type specific hashing
1640 const TypeAry *_ary; // Array we point into
1641 const bool _is_autobox_cache;
1642
1643 ciKlass* compute_klass() const;
1644
1645 // A pointer to delay allocation to Type::Initialize_shared()
1646
1647 static const TypeInterfaces* _array_interfaces;
1648 ciKlass* exact_klass_helper() const;
1649 // Only guaranteed non null for array of basic types
1650 ciKlass* klass() const;
1651
1652 public:
1653
|