Merge
authoriklam
Wed, 17 Jun 2015 22:49:17 +0000
changeset 31361 f3ec2edc1244
parent 31359 e9d8d21c21f3 (current diff)
parent 31360 87d3a62c7e35 (diff)
child 31364 782625e8fb3c
Merge
--- a/hotspot/src/share/vm/memory/filemap.cpp	Wed Jun 17 17:29:56 2015 +0200
+++ b/hotspot/src/share/vm/memory/filemap.cpp	Wed Jun 17 22:49:17 2015 +0000
@@ -647,8 +647,8 @@
   return base;
 }
 
-MemRegion *string_ranges = NULL;
-int num_ranges = 0;
+static MemRegion *string_ranges = NULL;
+static int num_ranges = 0;
 bool FileMapInfo::map_string_regions() {
 #if INCLUDE_ALL_GCS
   if (UseG1GC && UseCompressedOops && UseCompressedClassPointers) {
@@ -737,7 +737,10 @@
 }
 
 void FileMapInfo::fixup_string_regions() {
-  if (string_ranges != NULL) {
+  // If any string regions were found, call the fill routine to make them parseable.
+  // Note that string_ranges may be non-NULL even if no ranges were found.
+  if (num_ranges != 0) {
+    assert(string_ranges != NULL, "Null string_ranges array with non-zero count");
     G1CollectedHeap::heap()->fill_archive_regions(string_ranges, num_ranges);
   }
 }