From 7d78757ceca88226faea6671c77e54c46e0fb20c Mon Sep 17 00:00:00 2001 From: kvn Date: Thu, 25 Feb 2010 15:55:47 -0800 Subject: [PATCH] 6930035: C2 type system incorrectly handles case j.l.Object->meet(constant AryPtr) Summary: Add missing code. Reviewed-by: never --- src/share/vm/opto/type.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/share/vm/opto/type.cpp b/src/share/vm/opto/type.cpp index 289835af4..ba1cf3aa1 100644 --- a/src/share/vm/opto/type.cpp +++ b/src/share/vm/opto/type.cpp @@ -2809,7 +2809,8 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { // then we can subclass in the Java class hierarchy. if (klass()->equals(ciEnv::current()->Object_klass())) { // that is, tp's array type is a subtype of my klass - return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id); + return TypeAryPtr::make(ptr, (ptr == Constant ? tp->const_oop() : NULL), + tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id); } } // The other case cannot happen, since I cannot be a subtype of an array. @@ -3415,7 +3416,8 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { // then we can subclass in the Java class hierarchy. if( tp->klass()->equals(ciEnv::current()->Object_klass()) ) { // that is, my array type is a subtype of 'tp' klass - return make( ptr, _ary, _klass, _klass_is_exact, offset, instance_id ); + return make( ptr, (ptr == Constant ? const_oop() : NULL), + _ary, _klass, _klass_is_exact, offset, instance_id ); } } // The other case cannot happen, since t cannot be a subtype of an array. -- GitLab