# HG changeset patch # User coleenp # Date 1226073812 18000 # Node ID 05db98ed59baabd6c8d55e513594be05912ac81e # Parent 348be627a148a69f62f2033da6bf60c66367891f 6760773: UseCompressedOops is broken with UseParNewGC Summary: sparc code for gen_subtype_check was doing an ld for a compressed oop with the sign bit set so not comparing, leading to a ClassCastException. Reviewed-by: phh, never, acorn, kvn, xlu diff -r 348be627a148 -r 05db98ed59ba src/cpu/sparc/vm/interp_masm_sparc.cpp --- a/src/cpu/sparc/vm/interp_masm_sparc.cpp Fri Oct 31 10:34:20 2008 -0700 +++ b/src/cpu/sparc/vm/interp_masm_sparc.cpp Fri Nov 07 11:03:32 2008 -0500 @@ -906,7 +906,7 @@ // load next super to check if (UseCompressedOops) { - ld( Rtmp2, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Rtmp3); + lduw( Rtmp2, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Rtmp3); // Bump array pointer forward one oop add( Rtmp2, 4, Rtmp2 ); } else { diff -r 348be627a148 -r 05db98ed59ba src/cpu/sparc/vm/stubGenerator_sparc.cpp --- a/src/cpu/sparc/vm/stubGenerator_sparc.cpp Fri Oct 31 10:34:20 2008 -0700 +++ b/src/cpu/sparc/vm/stubGenerator_sparc.cpp Fri Nov 07 11:03:32 2008 -0500 @@ -956,7 +956,7 @@ // Load a little early; will load 1 off the end of the array. // Ok for now; revisit if we have other uses of this routine. if (UseCompressedOops) { - __ ld(L1_ary_ptr,0,L2_super);// Will load a little early + __ lduw(L1_ary_ptr,0,L2_super);// Will load a little early } else { __ ld_ptr(L1_ary_ptr,0,L2_super);// Will load a little early } @@ -973,7 +973,7 @@ #ifdef _LP64 __ subcc(L2_super,L4_ooptmp,Rret); // Check for match; zero in Rret for a hit __ br( Assembler::notEqual, false, Assembler::pt, loop ); - __ delayed()->ld(L1_ary_ptr,0,L2_super);// Will load a little early + __ delayed()->lduw(L1_ary_ptr,0,L2_super);// Will load a little early #else ShouldNotReachHere(); #endif