changeset 3598:bfff77083467

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
author kvn
date Thu, 30 Jul 2009 16:05:56 -0700
parents 572bbef24585
children 35bb709f2c62
files hotspot/src/cpu/x86/vm/assembler_x86.cpp
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp	Tue Jul 28 09:02:30 2009 +0200
+++ b/hotspot/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);
   }
 }