6869822: assert(Universe::narrow_oop_shift() == 0,"use unscaled narrow oop")
authorkvn
Fri, 14 Aug 2009 12:23:11 -0700
changeset 3677 2fc0673d704d
parent 3676 3bac3e882cd3
child 3680 498fd6035e79
6869822: assert(Universe::narrow_oop_shift() == 0,"use unscaled narrow oop") Summary: Replace the assert with narrow_oop_shift set to 0. Reviewed-by: never, jcoomes
hotspot/src/share/vm/memory/universe.cpp
--- a/hotspot/src/share/vm/memory/universe.cpp	Fri Aug 14 00:02:12 2009 -0700
+++ b/hotspot/src/share/vm/memory/universe.cpp	Fri Aug 14 12:23:11 2009 -0700
@@ -749,7 +749,10 @@
     assert(mode == UnscaledNarrowOop  ||
            mode == ZeroBasedNarrowOop ||
            mode == HeapBasedNarrowOop, "mode is invalid");
-
+    // Return specified base for the first request.
+    if (!FLAG_IS_DEFAULT(HeapBaseMinAddress) && (mode == UnscaledNarrowOop)) {
+      return (char*)HeapBaseMinAddress;
+    }
     const size_t total_size = heap_size + HeapBaseMinAddress;
     if (total_size <= OopEncodingHeapMax && (mode != HeapBasedNarrowOop)) {
       if (total_size <= NarrowOopHeapMax && (mode == UnscaledNarrowOop) &&
@@ -857,7 +860,7 @@
         // Can't reserve heap below 4Gb.
         Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
       } else {
-        assert(Universe::narrow_oop_shift() == 0, "use unscaled narrow oop");
+        Universe::set_narrow_oop_shift(0);
         if (PrintCompressedOopsMode) {
           tty->print(", 32-bits Oops");
         }