changeset 3602:03049e0e8544

7195823: NPG: CMS reserved() doesn't match _rs.base(). Summary: If the commit fails, the size isn't set so the assert fails. Reviewed-by: kamg
author coleenp
date Mon, 03 Sep 2012 18:37:12 -0400
parents da91efe96a93
children 46c017102631
files src/share/vm/memory/metaspace.cpp
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/memory/metaspace.cpp	Sat Sep 01 13:25:18 2012 -0400
+++ b/src/share/vm/memory/metaspace.cpp	Mon Sep 03 18:37:12 2012 -0400
@@ -1077,16 +1077,16 @@
     set_top((MetaWord*)virtual_space()->low());
     set_reserved(MemRegion((HeapWord*)_rs.base(),
                  (HeapWord*)(_rs.base() + _rs.size())));
+
+    assert(reserved()->start() == (HeapWord*) _rs.base(),
+      err_msg("Reserved start was not set properly " PTR_FORMAT
+        " != " PTR_FORMAT, reserved()->start(), _rs.base()));
+    assert(reserved()->word_size() == _rs.size() / BytesPerWord,
+      err_msg("Reserved size was not set properly " SIZE_FORMAT
+        " != " SIZE_FORMAT, reserved()->word_size(),
+        _rs.size() / BytesPerWord));
   }
 
-  assert(reserved()->start() == (HeapWord*) _rs.base(),
-    err_msg("Reserved start was not set properly " PTR_FORMAT
-      " != " PTR_FORMAT, reserved()->start(), _rs.base()));
-  assert(reserved()->word_size() == _rs.size() / BytesPerWord,
-    err_msg("Reserved size was not set properly " SIZE_FORMAT
-      " != " SIZE_FORMAT, reserved()->word_size(),
-      _rs.size() / BytesPerWord));
-
   return result;
 }