7195823: NPG: CMS reserved() doesn't match _rs.base().
authorcoleenp
Mon, 03 Sep 2012 18:37:12 -0400
changeset 13729 3826a6124401
parent 13728 882756847a04
child 13730 df5705977fc5
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
hotspot/src/share/vm/memory/metaspace.cpp
--- a/hotspot/src/share/vm/memory/metaspace.cpp	Sat Sep 01 13:25:18 2012 -0400
+++ b/hotspot/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;
 }