提交 8eb41b36 编写于 作者: R roland

8027140: Assertion in compiler when running bigapps/Kitchensink/stability

Summary: filter() code for TypeKlassPtr not moved when permgen removal was introduced
Reviewed-by: twisti, iveresov
上级 8e3fa5c9
...@@ -2787,13 +2787,11 @@ intptr_t TypeOopPtr::get_con() const { ...@@ -2787,13 +2787,11 @@ intptr_t TypeOopPtr::get_con() const {
//-----------------------------filter------------------------------------------ //-----------------------------filter------------------------------------------
// Do not allow interface-vs.-noninterface joins to collapse to top. // 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 Type* ft = join(kills);
const TypeInstPtr* ftip = ft->isa_instptr(); const TypeInstPtr* ftip = ft->isa_instptr();
const TypeInstPtr* ktip = kills->isa_instptr(); const TypeInstPtr* ktip = kills->isa_instptr();
const TypeKlassPtr* ftkp = ft->isa_klassptr();
const TypeKlassPtr* ktkp = kills->isa_klassptr();
if (ft->empty()) { if (ft->empty()) {
// Check for evil case of 'this' being a class and 'kills' expecting an // 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 { ...@@ -2807,8 +2805,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const {
// uplift the type. // uplift the type.
if (!empty() && ktip != NULL && ktip->is_loaded() && ktip->klass()->is_interface()) if (!empty() && ktip != NULL && ktip->is_loaded() && ktip->klass()->is_interface())
return kills; // Uplift to 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 return Type::TOP; // Canonical empty value
} }
...@@ -2825,14 +2821,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const { ...@@ -2825,14 +2821,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const {
assert(!ftip->klass_is_exact(), "interface could not be exact"); assert(!ftip->klass_is_exact(), "interface could not be exact");
return ktip->cast_to_ptr_type(ftip->ptr()); 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; return ft;
} }
...@@ -4385,6 +4373,33 @@ bool TypeKlassPtr::singleton(void) const { ...@@ -4385,6 +4373,33 @@ bool TypeKlassPtr::singleton(void) const {
return (_offset == 0) && !below_centerline(_ptr); 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_klass------------------------------------------
// Compute the defining klass for this class // Compute the defining klass for this class
ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const { ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const {
......
...@@ -63,7 +63,7 @@ class TypeRawPtr; ...@@ -63,7 +63,7 @@ class TypeRawPtr;
class TypeOopPtr; class TypeOopPtr;
class TypeInstPtr; class TypeInstPtr;
class TypeAryPtr; class TypeAryPtr;
class TypeKlassPtr; class TypeKlassPtr;
class TypeMetadataPtr; class TypeMetadataPtr;
//------------------------------Type------------------------------------------- //------------------------------Type-------------------------------------------
...@@ -1202,6 +1202,9 @@ public: ...@@ -1202,6 +1202,9 @@ public:
virtual intptr_t get_con() const; 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. // Convenience common pre-built types.
static const TypeKlassPtr* OBJECT; // Not-null object klass or below static const TypeKlassPtr* OBJECT; // Not-null object klass or below
static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册