Fri, 18 Sep 2009 09:57:47 -0700
6820514: meet not symmetric failure in ctw
Summary: Add missing instance_id meet.
Reviewed-by: never
src/share/vm/opto/type.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/type.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/type.cpp Wed Sep 16 11:06:10 2009 -0700 1.2 +++ b/src/share/vm/opto/type.cpp Fri Sep 18 09:57:47 2009 -0700 1.3 @@ -296,7 +296,7 @@ 1.4 false, 0, oopDesc::mark_offset_in_bytes()); 1.5 TypeInstPtr::KLASS = TypeInstPtr::make(TypePtr::BotPTR, current->env()->Object_klass(), 1.6 false, 0, oopDesc::klass_offset_in_bytes()); 1.7 - TypeOopPtr::BOTTOM = TypeOopPtr::make(TypePtr::BotPTR, OffsetBot); 1.8 + TypeOopPtr::BOTTOM = TypeOopPtr::make(TypePtr::BotPTR, OffsetBot, TypeOopPtr::InstanceBot); 1.9 1.10 TypeNarrowOop::NULL_PTR = TypeNarrowOop::make( TypePtr::NULL_PTR ); 1.11 TypeNarrowOop::BOTTOM = TypeNarrowOop::make( TypeInstPtr::BOTTOM ); 1.12 @@ -492,8 +492,13 @@ 1.13 bool Type::interface_vs_oop(const Type *t) const { 1.14 bool result = false; 1.15 1.16 - const TypeInstPtr* this_inst = this->isa_instptr(); 1.17 - const TypeInstPtr* t_inst = t->isa_instptr(); 1.18 + const TypePtr* this_ptr = this->make_ptr(); // In case it is narrow_oop 1.19 + const TypePtr* t_ptr = t->make_ptr(); 1.20 + if( this_ptr == NULL || t_ptr == NULL ) 1.21 + return result; 1.22 + 1.23 + const TypeInstPtr* this_inst = this_ptr->isa_instptr(); 1.24 + const TypeInstPtr* t_inst = t_ptr->isa_instptr(); 1.25 if( this_inst && this_inst->is_loaded() && t_inst && t_inst->is_loaded() ) { 1.26 bool this_interface = this_inst->klass()->is_interface(); 1.27 bool t_interface = t_inst->klass()->is_interface(); 1.28 @@ -2249,7 +2254,7 @@ 1.29 const Type *TypeOopPtr::cast_to_ptr_type(PTR ptr) const { 1.30 assert(_base == OopPtr, "subclass must override cast_to_ptr_type"); 1.31 if( ptr == _ptr ) return this; 1.32 - return make(ptr, _offset); 1.33 + return make(ptr, _offset, _instance_id); 1.34 } 1.35 1.36 //-----------------------------cast_to_instance_id---------------------------- 1.37 @@ -2319,8 +2324,10 @@ 1.38 if (ptr == Null) return TypePtr::make(AnyPtr, ptr, offset); 1.39 // else fall through: 1.40 case TopPTR: 1.41 - case AnyNull: 1.42 - return make(ptr, offset); 1.43 + case AnyNull: { 1.44 + int instance_id = meet_instance_id(InstanceTop); 1.45 + return make(ptr, offset, instance_id); 1.46 + } 1.47 case BotPTR: 1.48 case NotNull: 1.49 return TypePtr::make(AnyPtr, ptr, offset); 1.50 @@ -2593,7 +2600,7 @@ 1.51 1.52 //------------------------------add_offset------------------------------------- 1.53 const TypePtr *TypeOopPtr::add_offset( intptr_t offset ) const { 1.54 - return make( _ptr, xadd_offset(offset) ); 1.55 + return make( _ptr, xadd_offset(offset), _instance_id); 1.56 } 1.57 1.58 //------------------------------meet_instance_id-------------------------------- 1.59 @@ -2696,6 +2703,7 @@ 1.60 const TypeInstPtr *TypeInstPtr::xmeet_unloaded(const TypeInstPtr *tinst) const { 1.61 int off = meet_offset(tinst->offset()); 1.62 PTR ptr = meet_ptr(tinst->ptr()); 1.63 + int instance_id = meet_instance_id(tinst->instance_id()); 1.64 1.65 const TypeInstPtr *loaded = is_loaded() ? this : tinst; 1.66 const TypeInstPtr *unloaded = is_loaded() ? tinst : this; 1.67 @@ -2716,7 +2724,7 @@ 1.68 assert(loaded->ptr() != TypePtr::Null, "insanity check"); 1.69 // 1.70 if( loaded->ptr() == TypePtr::TopPTR ) { return unloaded; } 1.71 - else if (loaded->ptr() == TypePtr::AnyNull) { return TypeInstPtr::make( ptr, unloaded->klass() ); } 1.72 + else if (loaded->ptr() == TypePtr::AnyNull) { return TypeInstPtr::make( ptr, unloaded->klass(), false, NULL, off, instance_id ); } 1.73 else if (loaded->ptr() == TypePtr::BotPTR ) { return TypeInstPtr::BOTTOM; } 1.74 else if (loaded->ptr() == TypePtr::Constant || loaded->ptr() == TypePtr::NotNull) { 1.75 if (unloaded->ptr() == TypePtr::BotPTR ) { return TypeInstPtr::BOTTOM; }
2.1 --- a/src/share/vm/opto/type.hpp Wed Sep 16 11:06:10 2009 -0700 2.2 +++ b/src/share/vm/opto/type.hpp Fri Sep 18 09:57:47 2009 -0700 2.3 @@ -717,7 +717,7 @@ 2.4 static const TypeOopPtr* make_from_constant(ciObject* o, bool require_constant = false); 2.5 2.6 // Make a generic (unclassed) pointer to an oop. 2.7 - static const TypeOopPtr* make(PTR ptr, int offset, int instance_id = InstanceBot); 2.8 + static const TypeOopPtr* make(PTR ptr, int offset, int instance_id); 2.9 2.10 ciObject* const_oop() const { return _const_oop; } 2.11 virtual ciKlass* klass() const { return _klass; }