comparison src/share/vm/opto/type.hpp @ 23293:071a85b9e631

Fix interface_vs_oop assertion logic for array types
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 28 Jan 2016 20:18:25 -0800
parents 52b4284cb496
children f13e777eb255
comparison
equal deleted inserted replaced
23292:7eb99acd567f 23293:071a85b9e631
157 // lazily, on demand, and cached in _dual. 157 // lazily, on demand, and cached in _dual.
158 const Type *_dual; // Cached dual value 158 const Type *_dual; // Cached dual value
159 // Table for efficient dualing of base types 159 // Table for efficient dualing of base types
160 static const TYPES dual_type[lastype]; 160 static const TYPES dual_type[lastype];
161 161
162 #ifdef ASSERT
163 // One type is interface, the other is oop
164 virtual bool interface_vs_oop_helper(const Type *t) const;
165 #endif
166
167 const Type *meet_helper(const Type *t, bool include_speculative) const; 162 const Type *meet_helper(const Type *t, bool include_speculative) const;
168 163
169 protected: 164 protected:
170 // Each class of type is also identified by its base. 165 // Each class of type is also identified by its base.
171 const TYPES _base; // Enum of Types type 166 const TYPES _base; // Enum of Types type
175 const Type *hashcons(); // Hash-cons the type 170 const Type *hashcons(); // Hash-cons the type
176 virtual const Type *filter_helper(const Type *kills, bool include_speculative) const; 171 virtual const Type *filter_helper(const Type *kills, bool include_speculative) const;
177 const Type *join_helper(const Type *t, bool include_speculative) const { 172 const Type *join_helper(const Type *t, bool include_speculative) const {
178 return dual()->meet_helper(t->dual(), include_speculative)->dual(); 173 return dual()->meet_helper(t->dual(), include_speculative)->dual();
179 } 174 }
175
176 #ifdef ASSERT
177 // One type is interface, the other is oop. Override to perform subtype specific
178 // interface_vs_oop checking.
179 virtual bool interface_vs_oop_helper(const Type *t) const;
180 #endif
180 181
181 public: 182 public:
182 183
183 inline void* operator new( size_t x ) throw() { 184 inline void* operator new( size_t x ) throw() {
184 Compile* compile = Compile::current(); 185 Compile* compile = Compile::current();
679 virtual const Type *xdual() const; // Compute dual right now. 680 virtual const Type *xdual() const; // Compute dual right now.
680 bool ary_must_be_exact() const; // true if arrays of such are never generic 681 bool ary_must_be_exact() const; // true if arrays of such are never generic
681 virtual const Type* remove_speculative() const; 682 virtual const Type* remove_speculative() const;
682 #ifdef ASSERT 683 #ifdef ASSERT
683 // One type is interface, the other is oop 684 // One type is interface, the other is oop
684 virtual bool interface_vs_oop(const Type *t) const; 685 virtual bool interface_vs_oop_helper(const Type *t) const;
685 #endif 686 #endif
686 #ifndef PRODUCT 687 #ifndef PRODUCT
687 virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping 688 virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping
688 #endif 689 #endif
689 }; 690 };
1165 } 1166 }
1166 static const TypeAryPtr *_array_body_type[T_CONFLICT+1]; 1167 static const TypeAryPtr *_array_body_type[T_CONFLICT+1];
1167 // sharpen the type of an int which is used as an array size 1168 // sharpen the type of an int which is used as an array size
1168 #ifdef ASSERT 1169 #ifdef ASSERT
1169 // One type is interface, the other is oop 1170 // One type is interface, the other is oop
1170 virtual bool interface_vs_oop(const Type *t) const; 1171 virtual bool interface_vs_oop_helper(const Type *t) const;
1171 #endif 1172 #endif
1172 #ifndef PRODUCT 1173 #ifndef PRODUCT
1173 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping 1174 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
1174 #endif 1175 #endif
1175 }; 1176 };