changeset 13037:c8fc12209830

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
author coleenp
date Thu, 31 Oct 2013 14:11:02 -0400
parents 4fe7815b04f5
children 910026b800b8 42790b7e4d48
files src/share/vm/memory/metaspace.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/memory/metaspace.cpp	Wed Oct 30 09:26:44 2013 -0700
+++ b/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.