# HG changeset patch # User kvn # Date 1248995156 25200 # Node ID 60fea60a6db50d37ba23a11dab7905d5f2b0e994 # Parent 52898b0c43e9e606038e64e470be40582ec92d81 6864914: SPECjvm2008 produces invalid result with zero based Compressed Oops Summary: Always use "lea" instruction for narrow oop decoding instead of "shift". Reviewed-by: never diff -r 52898b0c43e9 -r 60fea60a6db5 src/cpu/x86/vm/assembler_x86.cpp --- a/src/cpu/x86/vm/assembler_x86.cpp Tue Jul 28 09:02:30 2009 +0200 +++ b/src/cpu/x86/vm/assembler_x86.cpp Thu Jul 30 16:05:56 2009 -0700 @@ -8335,15 +8335,13 @@ // Cannot assert, unverified entry point counts instructions (see .ad file) // vtableStubs also counts instructions in pd_code_size_limit. // Also do not verify_oop as this is called by verify_oop. - if (Universe::narrow_oop_base() == NULL) { - if (Universe::narrow_oop_shift() != 0) { - assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); - shlq(r, LogMinObjAlignmentInBytes); - } + if (Universe::narrow_oop_shift() != 0) { + assert (Address::times_8 == LogMinObjAlignmentInBytes && + Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong"); + // Don't use Shift since it modifies flags. + leaq(r, Address(r12_heapbase, r, Address::times_8, 0)); } else { - assert (Address::times_8 == LogMinObjAlignmentInBytes && - Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong"); - leaq(r, Address(r12_heapbase, r, Address::times_8, 0)); + assert (Universe::narrow_oop_base() == NULL, "sanity"); } } @@ -8358,6 +8356,7 @@ Address::times_8 == Universe::narrow_oop_shift(), "decode alg wrong"); leaq(dst, Address(r12_heapbase, src, Address::times_8, 0)); } else if (dst != src) { + assert (Universe::narrow_oop_base() == NULL, "sanity"); movq(dst, src); } }