8027140: Assertion in compiler when running bigapps/Kitchensink/stability
Filter() code for TypeKlassPtr not moved when permgen removal was introduced Reviewed-by: twisti, iveresov
This commit is contained in:
parent
cf3a7f1dcc
commit
9ba485b29f
@ -2787,13 +2787,11 @@ intptr_t TypeOopPtr::get_con() const {
|
||||
|
||||
//-----------------------------filter------------------------------------------
|
||||
// Do not allow interface-vs.-noninterface joins to collapse to top.
|
||||
const Type *TypeOopPtr::filter( const Type *kills ) const {
|
||||
const Type *TypeOopPtr::filter(const Type *kills) const {
|
||||
|
||||
const Type* ft = join(kills);
|
||||
const TypeInstPtr* ftip = ft->isa_instptr();
|
||||
const TypeInstPtr* ktip = kills->isa_instptr();
|
||||
const TypeKlassPtr* ftkp = ft->isa_klassptr();
|
||||
const TypeKlassPtr* ktkp = kills->isa_klassptr();
|
||||
|
||||
if (ft->empty()) {
|
||||
// Check for evil case of 'this' being a class and 'kills' expecting an
|
||||
@ -2807,8 +2805,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const {
|
||||
// uplift the type.
|
||||
if (!empty() && ktip != NULL && ktip->is_loaded() && ktip->klass()->is_interface())
|
||||
return kills; // Uplift to interface
|
||||
if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface())
|
||||
return kills; // Uplift to interface
|
||||
|
||||
return Type::TOP; // Canonical empty value
|
||||
}
|
||||
@ -2825,14 +2821,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const {
|
||||
assert(!ftip->klass_is_exact(), "interface could not be exact");
|
||||
return ktip->cast_to_ptr_type(ftip->ptr());
|
||||
}
|
||||
// Interface klass type could be exact in opposite to interface type,
|
||||
// return it here instead of incorrect Constant ptr J/L/Object (6894807).
|
||||
if (ftkp != NULL && ktkp != NULL &&
|
||||
ftkp->is_loaded() && ftkp->klass()->is_interface() &&
|
||||
!ftkp->klass_is_exact() && // Keep exact interface klass
|
||||
ktkp->is_loaded() && !ktkp->klass()->is_interface()) {
|
||||
return ktkp->cast_to_ptr_type(ftkp->ptr());
|
||||
}
|
||||
|
||||
return ft;
|
||||
}
|
||||
@ -4385,6 +4373,33 @@ bool TypeKlassPtr::singleton(void) const {
|
||||
return (_offset == 0) && !below_centerline(_ptr);
|
||||
}
|
||||
|
||||
// Do not allow interface-vs.-noninterface joins to collapse to top.
|
||||
const Type *TypeKlassPtr::filter(const Type *kills) const {
|
||||
// logic here mirrors the one from TypeOopPtr::filter. See comments
|
||||
// there.
|
||||
const Type* ft = join(kills);
|
||||
const TypeKlassPtr* ftkp = ft->isa_klassptr();
|
||||
const TypeKlassPtr* ktkp = kills->isa_klassptr();
|
||||
|
||||
if (ft->empty()) {
|
||||
if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface())
|
||||
return kills; // Uplift to interface
|
||||
|
||||
return Type::TOP; // Canonical empty value
|
||||
}
|
||||
|
||||
// Interface klass type could be exact in opposite to interface type,
|
||||
// return it here instead of incorrect Constant ptr J/L/Object (6894807).
|
||||
if (ftkp != NULL && ktkp != NULL &&
|
||||
ftkp->is_loaded() && ftkp->klass()->is_interface() &&
|
||||
!ftkp->klass_is_exact() && // Keep exact interface klass
|
||||
ktkp->is_loaded() && !ktkp->klass()->is_interface()) {
|
||||
return ktkp->cast_to_ptr_type(ftkp->ptr());
|
||||
}
|
||||
|
||||
return ft;
|
||||
}
|
||||
|
||||
//----------------------compute_klass------------------------------------------
|
||||
// Compute the defining klass for this class
|
||||
ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const {
|
||||
|
@ -63,7 +63,7 @@ class TypeRawPtr;
|
||||
class TypeOopPtr;
|
||||
class TypeInstPtr;
|
||||
class TypeAryPtr;
|
||||
class TypeKlassPtr;
|
||||
class TypeKlassPtr;
|
||||
class TypeMetadataPtr;
|
||||
|
||||
//------------------------------Type-------------------------------------------
|
||||
@ -1202,6 +1202,9 @@ public:
|
||||
|
||||
virtual intptr_t get_con() const;
|
||||
|
||||
// Do not allow interface-vs.-noninterface joins to collapse to top.
|
||||
virtual const Type *filter( const Type *kills ) const;
|
||||
|
||||
// Convenience common pre-built types.
|
||||
static const TypeKlassPtr* OBJECT; // Not-null object klass or below
|
||||
static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same
|
||||
|
Loading…
Reference in New Issue
Block a user