--- a/hotspot/src/share/vm/memory/universe.cpp Fri Jun 07 09:33:01 2013 -0700
+++ b/hotspot/src/share/vm/memory/universe.cpp Mon Jun 10 11:30:51 2013 +0200
@@ -819,12 +819,14 @@
// keep the Universe::narrow_oop_base() set in Universe::reserve_heap()
Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
if (verbose) {
- tty->print(", Compressed Oops with base: "PTR_FORMAT, Universe::narrow_oop_base());
+ tty->print(", %s: "PTR_FORMAT,
+ narrow_oop_mode_to_string(HeapBasedNarrowOop),
+ Universe::narrow_oop_base());
}
} else {
Universe::set_narrow_oop_base(0);
if (verbose) {
- tty->print(", zero based Compressed Oops");
+ tty->print(", %s", narrow_oop_mode_to_string(ZeroBasedNarrowOop));
}
#ifdef _WIN64
if (!Universe::narrow_oop_use_implicit_null_checks()) {
@@ -839,7 +841,7 @@
} else {
Universe::set_narrow_oop_shift(0);
if (verbose) {
- tty->print(", 32-bits Oops");
+ tty->print(", %s", narrow_oop_mode_to_string(UnscaledNarrowOop));
}
}
}
@@ -946,6 +948,33 @@
}
+const char* Universe::narrow_oop_mode_to_string(Universe::NARROW_OOP_MODE mode) {
+ switch (mode) {
+ case UnscaledNarrowOop:
+ return "32-bits Oops";
+ case ZeroBasedNarrowOop:
+ return "zero based Compressed Oops";
+ case HeapBasedNarrowOop:
+ return "Compressed Oops with base";
+ }
+
+ ShouldNotReachHere();
+ return "";
+}
+
+
+Universe::NARROW_OOP_MODE Universe::narrow_oop_mode() {
+ if (narrow_oop_base() != 0) {
+ return HeapBasedNarrowOop;
+ }
+
+ if (narrow_oop_shift() != 0) {
+ return ZeroBasedNarrowOop;
+ }
+
+ return UnscaledNarrowOop;
+}
+
void universe2_init() {
EXCEPTION_MARK;