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