Thu, 21 Jan 2010 10:07:59 -0800
6894807: No ClassCastException for HashAttributeSet constructors if run with -Xcomp
Summary: Return interface klass type if it is exact.
Reviewed-by: never
src/share/vm/opto/cfgnode.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/type.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/cfgnode.cpp Thu Dec 03 14:20:22 2009 -0800 1.2 +++ b/src/share/vm/opto/cfgnode.cpp Thu Jan 21 10:07:59 2010 -0800 1.3 @@ -956,6 +956,7 @@ 1.4 } 1.5 if( jtkp && ttkp ) { 1.6 if( jtkp->is_loaded() && jtkp->klass()->is_interface() && 1.7 + !jtkp->klass_is_exact() && // Keep exact interface klass (6894807) 1.8 ttkp->is_loaded() && !ttkp->klass()->is_interface() ) { 1.9 assert(ft == ttkp->cast_to_ptr_type(jtkp->ptr()) || 1.10 ft->isa_narrowoop() && ft->make_ptr() == ttkp->cast_to_ptr_type(jtkp->ptr()), "");
2.1 --- a/src/share/vm/opto/type.cpp Thu Dec 03 14:20:22 2009 -0800 2.2 +++ b/src/share/vm/opto/type.cpp Thu Jan 21 10:07:59 2010 -0800 2.3 @@ -2545,12 +2545,15 @@ 2.4 ftip->is_loaded() && ftip->klass()->is_interface() && 2.5 ktip->is_loaded() && !ktip->klass()->is_interface()) { 2.6 // Happens in a CTW of rt.jar, 320-341, no extra flags 2.7 + assert(!ftip->klass_is_exact(), "interface could not be exact"); 2.8 return ktip->cast_to_ptr_type(ftip->ptr()); 2.9 } 2.10 + // Interface klass type could be exact in opposite to interface type, 2.11 + // return it here instead of incorrect Constant ptr J/L/Object (6894807). 2.12 if (ftkp != NULL && ktkp != NULL && 2.13 ftkp->is_loaded() && ftkp->klass()->is_interface() && 2.14 + !ftkp->klass_is_exact() && // Keep exact interface klass 2.15 ktkp->is_loaded() && !ktkp->klass()->is_interface()) { 2.16 - // Happens in a CTW of rt.jar, 320-341, no extra flags 2.17 return ktkp->cast_to_ptr_type(ftkp->ptr()); 2.18 } 2.19