8027616: Off by one error in putback for compressed oops nashorn performance improvement
authorcoleenp
Thu, 31 Oct 2013 14:11:02 -0400
changeset 21518 067dd7967128
parent 21517 cf4ca6e73f1c
child 21519 72e63a0dbda2
child 21520 9f3ba7e1ed5c
8027616: Off by one error in putback for compressed oops nashorn performance improvement Summary: Should compare bounds greater than or equal 4G when deciding if shift is needed or CDS area + compressed class space are within 4G of each other. Reviewed-by: stefank, hseigel, zgu
hotspot/src/share/vm/memory/metaspace.cpp
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Wed Oct 30 09:26:44 2013 -0700
+++ b/hotspot/src/share/vm/memory/metaspace.cpp	Thu Oct 31 14:11:02 2013 -0400
@@ -2869,7 +2869,7 @@
 
   Universe::set_narrow_klass_base(lower_base);
 
-  if ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax) {
+  if ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax) {
     Universe::set_narrow_klass_shift(0);
   } else {
     assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces");
@@ -2885,7 +2885,7 @@
   address lower_base = MIN2((address)metaspace_base, cds_base);
   address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()),
                                 (address)(metaspace_base + compressed_class_space_size()));
-  return ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax);
+  return ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax);
 }
 
 // Try to allocate the metaspace at the requested addr.